зеркало из https://github.com/github/ruby.git
[ruby/yarp] fix: ":" at the end of a file
Previously this resulted in invalid memory access. Found by the fuzzer. https://github.com/ruby/yarp/commit/c781c9fcd2
This commit is contained in:
Родитель
3da139d284
Коммит
476f38d62d
|
@ -13,4 +13,5 @@ class FuzzerTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
snippet "incomplete global variable", "$"
|
||||
snippet "incomplete symbol", ":"
|
||||
end
|
||||
|
|
|
@ -6581,7 +6581,7 @@ parser_lex(yp_parser_t *parser) {
|
|||
LEX(YP_TOKEN_COLON_COLON);
|
||||
}
|
||||
|
||||
if (lex_state_end_p(parser) || yp_char_is_whitespace(*parser->current.end) || peek(parser) == '#') {
|
||||
if (lex_state_end_p(parser) || yp_char_is_whitespace(peek(parser)) || peek(parser) == '#') {
|
||||
lex_state_set(parser, YP_LEX_STATE_BEG);
|
||||
LEX(YP_TOKEN_COLON);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче