From 6dc231496501f01df43793efdd9aeb43349ed8bc Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Fri, 23 Jun 2023 09:58:16 +0100 Subject: [PATCH] [ruby/yarp] Don't read past the end of input parsing regex group https://github.com/ruby/yarp/commit/03f5a330a9 --- yarp/regexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarp/regexp.c b/yarp/regexp.c index e1de6de7c17911..cf9dba95c52052 100644 --- a/yarp/regexp.c +++ b/yarp/regexp.c @@ -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; }