mirror of
https://github.com/mirror/make.git
synced 2025-03-25 01:00:30 +08:00
* 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.
This commit is contained in:
parent
ac9a39dad7
commit
9ef06be018
5
read.c
5
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user