From: Kai Pastor Date: Sat, 4 Jan 2025 10:48:26 +0000 (+0100) Subject: Fix buildinf.h generation for space and backslash X-Git-Tag: openssl-3.1.8~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba0fdad773d0b1d1a4a3155c7c5a76f87dee5fdb;p=thirdparty%2Fopenssl.git 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 Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/26315) (cherry picked from commit e87a3473fd1e9d901a89d4b14a53826723357701) --- diff --git a/util/mkbuildinf.pl b/util/mkbuildinf.pl index 7b1aba054cc..a892a4396f2 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