summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-14 06:27:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-14 06:27:18 +0000
commitaa79984980d8dd741b441543bddb4cf1de6816ec (patch)
tree96a9ff8c8e0f2c4b61c68b445e32a75e22f0ba16 /regex.c
parent561c59bf64a4d6c2ed40451e7483c4c036965bab (diff)
* parse.y (read_escape): deny zero-width hexadecimal character.
(ruby-bugs-ja:PR#260) * parse.y (tokadd_escape): ditto. * regex.c (re_compile_pattern): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/regex.c b/regex.c
index 715eea2..9cb4b75 100644
--- a/regex.c
+++ b/regex.c
@@ -1531,6 +1531,7 @@ re_compile_pattern(pattern, size, bufp)
case 'x':
c = scan_hex(p, 2, &numlen);
+ if (numlen == 0) goto invalid_escape;
p += numlen;
had_num_literal = 1;
break;
@@ -2248,6 +2249,7 @@ re_compile_pattern(pattern, size, bufp)
case 'x':
had_mbchar = 0;
c = scan_hex(p, 2, &numlen);
+ if (numlen == 0) goto invalid_escape;
p += numlen;
had_num_literal = 1;
goto numeric_char;