aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y8
1 files changed, 8 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index a200f0b14e..e4f4627dc9 100644
--- a/parse.y
+++ b/parse.y
@@ -2416,6 +2416,10 @@ read_escape()
int numlen;
c = scan_hex(lex_p, 2, &numlen);
+ if (numlen == 0) {
+ yyerror("Invalid escape character syntax");
+ return 0;
+ }
lex_p += numlen;
}
return c;
@@ -2501,6 +2505,10 @@ tokadd_escape(term)
tokadd('\\');
tokadd(c);
scan_hex(lex_p, 2, &numlen);
+ if (numlen == 0) {
+ yyerror("Invalid escape character syntax");
+ return -1;
+ }
while (numlen--)
tokadd(nextc());
}