summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-27 01:54:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-27 01:54:23 +0000
commit422efe53527f5e0a7a80478947a7b338e8b199c7 (patch)
treed32ffbff8f870d95c767f51cae2bf0e620a6b529 /parse.y
parent87ba383aa38dbf81b6aa3fa9c771e7ac715f3c96 (diff)
* parse.y (parser_read_escape): deny extra character escapes.
[ruby-core:27228] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 52de93e8fe..2a05211d49 100644
--- a/parse.y
+++ b/parse.y
@@ -5593,6 +5593,7 @@ parser_read_escape(struct parser_params *parser, int flags,
goto eof;
}
if ((c = nextc()) == '\\') {
+ if (peek('u')) goto eof;
return read_escape(flags|ESCAPE_META, encp) | 0x80;
}
else if (c == -1 || !ISASCII(c)) goto eof;
@@ -5608,6 +5609,7 @@ parser_read_escape(struct parser_params *parser, int flags,
case 'c':
if (flags & ESCAPE_CONTROL) goto eof;
if ((c = nextc())== '\\') {
+ if (peek('u')) goto eof;
c = read_escape(flags|ESCAPE_CONTROL, encp);
}
else if (c == '?')