Skip to content

Commit c23d8bc

Browse files
Prevent an infinite loop parsing a capture name
Fixes #3729.
1 parent 3340d87 commit c23d8bc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/prism.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21163,6 +21163,9 @@ pm_named_capture_escape_unicode(pm_parser_t *parser, pm_buffer_t *unescaped, con
2116321163
}
2116421164

2116521165
size_t length = pm_strspn_hexadecimal_digit(cursor, end - cursor);
21166+
if (length == 0) {
21167+
break;
21168+
}
2116621169
uint32_t value = escape_unicode(parser, cursor, length);
2116721170

2116821171
(void) pm_buffer_append_unicode_codepoint(unescaped, value);

0 commit comments

Comments
 (0)