configdata.pm.in: Don't try to quotify undefined values
authorRichard Levitte <levitte@openssl.org>
Sun, 1 Dec 2019 07:20:09 +0000 (08:20 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 3 Dec 2019 23:19:40 +0000 (00:19 +0100)
Fixes #10503

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/10548)

configdata.pm.in

index 312122686f4da4d06ce52bd00991a71b718b8b89..71627b48ef49998d5cc839fd6b798dfb2d6a1db3 100644 (file)
@@ -245,7 +245,13 @@ _____
         foreach (sort keys %target) {
             next if $_ =~ m|^_| || $_ eq 'template';
             my $quotify = sub {
-                map { (my $x = $_) =~ s|([\\\$\@"])|\\$1|g; "\"$x\""} @_;
+                map {
+                    if (defined $_) {
+                        (my $x = $_) =~ s|([\\\$\@"])|\\$1|g; "\"$x\""
+                    } else {
+                        "undef";
+                    }
+                } @_;
             };
             print '    ', $_, ' => ';
             if (ref($target{$_}) eq "ARRAY") {