From: Paul Smith Date: Sun, 12 Jul 2015 16:35:42 +0000 (-0400) Subject: * read.c (unescape_char): [SV 45050] Handle final backslashes. X-Git-Tag: 4.1.90~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ef06be018627773e6dcea2a37f0e03fea575741;p=thirdparty%2Fmake.git * read.c (unescape_char): [SV 45050] Handle final backslashes. If the last thing in the string to be unescaped is a backslash, stop without reading beyond the end of the string. --- diff --git a/read.c b/read.c index e67d386e..2b5f08d1 100644 --- a/read.c +++ b/read.c @@ -2343,6 +2343,10 @@ unescape_char (char *string, int c) /* It's not; just take it all without unescaping. */ memmove (p, s, l); p += l; + + // If we hit the end of the string, we're done + if (*e == '\0') + break; } else if (l > 1) { @@ -2351,6 +2355,7 @@ unescape_char (char *string, int c) memmove (p, s, l); p += l; } + s = e; }