[ruby/yarp] If ? is last char of regexp buffer, don't read beyond it.

https://github.com/ruby/yarp/commit/1764532572
This commit is contained in:
Steven Johnstone 2023-06-23 10:53:38 +01:00 committed by git
parent 6dc2314965
commit 6ee106ff79

View File

@ -338,6 +338,9 @@ static bool
yp_regexp_parse_group(yp_regexp_parser_t *parser) {
// First, parse any options for the group.
if (yp_regexp_char_accept(parser, '?')) {
if (yp_regexp_char_is_eof(parser)) {
return false;
}
yp_regexp_options_t options;
yp_regexp_options_init(&options);