Skip to content

Commit 6dc2314

Browse files
stevenjohnstonematzbot
authored andcommitted
[ruby/yarp] Don't read past the end of input parsing regex group
ruby/prism@03f5a330a9
1 parent 7ce6bca commit 6dc2314

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

yarp/regexp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ yp_regexp_parse_group(yp_regexp_parser_t *parser) {
380380
break;
381381
case '\'': { // named capture group
382382
const char *start = ++parser->cursor;
383-
if (!yp_regexp_char_find(parser, '\'')) {
383+
if (yp_regexp_char_is_eof(parser) || !yp_regexp_char_find(parser, '\'')) {
384384
return false;
385385
}
386386

0 commit comments

Comments
 (0)