summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-18 16:53:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-18 16:53:12 +0000
commit94175959938eff1977b6895e98c626bae31788ac (patch)
treebc0247b40e9f718ba34f88a012d8b953576a58e8 /parse.y
parent30e97cbb8b4095250784cae859ba970413451f45 (diff)
* parse.y (parser_read_escape): disallow control and meta modifiers
for non-ASCII characters. [ruby-core:13685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index eb3a250120..907f0c2de2 100644
--- a/parse.y
+++ b/parse.y
@@ -5140,7 +5140,7 @@ parser_read_escape(struct parser_params *parser, int flags,
*has8bit = 1;
return read_escape(flags|ESCAPE_META, &tmp, &tmp, encp) | 0x80;
}
- else if (c == -1) goto eof;
+ else if (c == -1 || !ISASCII(c)) goto eof;
else {
*has8bit = 1;
return ((c & 0xff) | 0x80);
@@ -5159,7 +5159,7 @@ parser_read_escape(struct parser_params *parser, int flags,
}
else if (c == '?')
return 0177;
- else if (c == -1) goto eof;
+ else if (c == -1 || !ISASCII(c)) goto eof;
return c & 0x9f;
eof: