From: Nicolas Roche Date: Tue, 11 May 2021 05:58:42 +0000 (+0200) Subject: [Ada] Handle malformed command line on Win32 X-Git-Tag: basepoints/gcc-13~6236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8870b1f64ae927e9469082490760b760ef5616f;p=thirdparty%2Fgcc.git [Ada] Handle malformed command line on Win32 gcc/ada/ * rtinit.c (skip_quoted_string): Handle malformed command line with no closing double quote. (skip_argument): Handle case in which a null character is encountered by skip_quote_string. --- diff --git a/gcc/ada/rtinit.c b/gcc/ada/rtinit.c index 391c7e9406f3..83a63c8eb459 100644 --- a/gcc/ada/rtinit.c +++ b/gcc/ada/rtinit.c @@ -147,6 +147,19 @@ static void skip_quoted_string (const WCHAR **current_in, } ci++; } + + /* Handle the case in which a nul character was found instead of a closing + double quote. In that case consider all the backslashes as literal + characters. */ + if (*ci == '\0') + { + for (int i=0; i