mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 20:19:19 +00:00
[ruby/prism] Prevent an infinite loop parsing a capture name
Fixes https://github.com/ruby/prism/pull/3729. https://github.com/ruby/prism/commit/6e5347803c
This commit is contained in:
parent
8f2c479fa5
commit
0561eb9425
@ -20395,6 +20395,9 @@ pm_named_capture_escape_unicode(pm_parser_t *parser, pm_buffer_t *unescaped, con
|
||||
}
|
||||
|
||||
size_t length = pm_strspn_hexadecimal_digit(cursor, end - cursor);
|
||||
if (length == 0) {
|
||||
break;
|
||||
}
|
||||
uint32_t value = escape_unicode(parser, cursor, length);
|
||||
|
||||
(void) pm_buffer_append_unicode_codepoint(unescaped, value);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user