summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Pastor <dg0yt@darc.de>2025-01-04 11:48:26 +0100
committerRichard Levitte <levitte@openssl.org>2025-01-10 11:56:38 +0100
commite87a3473fd1e9d901a89d4b14a53826723357701 (patch)
tree6400d7ba2e8d9c09375579d2f597693744c571b2
parentUpdate error codes in "crypto/err/openssl.txt" (diff)
downloadopenssl-e87a3473fd1e9d901a89d4b14a53826723357701.tar.xz
openssl-e87a3473fd1e9d901a89d4b14a53826723357701.zip
Fix buildinf.h generation for space and backslash
Builds may be configured with CC or CFLAGS containing space and double quotes. In particular on Windows, this may lead to passing more than two arguments into mkbuildinf.pl. In addition, backslashes must be escaped for constructing the C string. Fixes #26253. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/26315)
-rwxr-xr-xutil/mkbuildinf.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/mkbuildinf.pl b/util/mkbuildinf.pl
index 7b1aba054c..a892a4396f 100755
--- a/util/mkbuildinf.pl
+++ b/util/mkbuildinf.pl
@@ -9,7 +9,9 @@
use strict;
use warnings;
-my ($cflags, $platform) = @ARGV;
+my $platform = pop @ARGV;
+my $cflags = join(' ', @ARGV);
+$cflags =~ s(\\)(\\\\)g;
$cflags = "compiler: $cflags";
# Use the value of the envvar SOURCE_DATE_EPOCH, even if it's