Commit 1a6e3d52 by Richard Kenner

(make_definition): Don't dump core when given an unterminated string

in a -D option.

From-SVN: r8013
parent aae43c5f
...@@ -9289,7 +9289,18 @@ make_definition (str, op) ...@@ -9289,7 +9289,18 @@ make_definition (str, op)
p++; p++;
q = &buf[p - str]; q = &buf[p - str];
while (*p) { while (*p) {
if (*p == '\\' && p[1] == '\n') if (*p == '\"' || *p == '\'') {
int unterminated = 0;
U_CHAR *p1 = skip_quoted_string (p, p + strlen (p), 0,
NULL_PTR, NULL_PTR, &unterminated);
if (unterminated)
return;
while (p != p1)
if (*p == '\\' && p[1] == '\n')
p += 2;
else
*q++ = *p++;
} else if (*p == '\\' && p[1] == '\n')
p += 2; p += 2;
/* Change newline chars into newline-markers. */ /* Change newline chars into newline-markers. */
else if (*p == '\n') else if (*p == '\n')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment