[ruby/yarp] Don't read past the end of input parsing regex group

https://github.com/ruby/yarp/commit/03f5a330a9
This commit is contained in:
Steven Johnstone 2023-06-23 09:58:16 +01:00 committed by git
parent 7ce6bcaf8b
commit 6dc2314965

View File

@ -380,7 +380,7 @@ yp_regexp_parse_group(yp_regexp_parser_t *parser) {
break;
case '\'': { // named capture group
const char *start = ++parser->cursor;
if (!yp_regexp_char_find(parser, '\'')) {
if (yp_regexp_char_is_eof(parser) || !yp_regexp_char_find(parser, '\'')) {
return false;
}