summaryrefslogtreecommitdiff
path: root/yarp/regexp.c
diff options
context:
space:
mode:
authorSteven Johnstone <[email protected]>2023-06-23 09:58:16 +0100
committergit <[email protected]>2023-06-23 19:56:39 +0000
commit6dc231496501f01df43793efdd9aeb43349ed8bc (patch)
tree305aa5ad9f15218a964dd91a8a82ccf8efc4a125 /yarp/regexp.c
parent7ce6bcaf8b1f06ff27920f287f534b9c19d9ccc3 (diff)
[ruby/yarp] Don't read past the end of input parsing regex group
https://github.com/ruby/yarp/commit/03f5a330a9
Diffstat (limited to 'yarp/regexp.c')
-rw-r--r--yarp/regexp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/yarp/regexp.c b/yarp/regexp.c
index e1de6de7c1..cf9dba95c5 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;
}