diff options
author | Steven Johnstone <steven.james.johnstone@gmail.com> | 2023-06-23 10:53:38 +0100 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-06-23 19:56:39 +0000 |
commit | 6ee106ff7953c155fe9b04ae7d9fe4f4617d7348 (patch) | |
tree | 5eb7c058a9b59a1df46d86b3177ebdc6ac893a76 /yarp | |
parent | 6dc231496501f01df43793efdd9aeb43349ed8bc (diff) | |
download | ruby-6ee106ff7953c155fe9b04ae7d9fe4f4617d7348.tar.gz |
[ruby/yarp] If ? is last char of regexp buffer, don't read beyond it.
https://github.com/ruby/yarp/commit/1764532572
Diffstat (limited to 'yarp')
-rw-r--r-- | yarp/regexp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/yarp/regexp.c b/yarp/regexp.c index cf9dba95c5..89eda53142 100644 --- a/yarp/regexp.c +++ b/yarp/regexp.c @@ -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); |