mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
HEREDOC could fail with NUL terminated lines; fix#3244
This commit is contained in:
@@ -3907,6 +3907,8 @@ parse_string(parser_state *p)
|
||||
int end = (intptr_t)p->lex_strterm->cdr->cdr->cdr;
|
||||
parser_heredoc_info *hinf = (type & STR_FUNC_HEREDOC) ? parsing_heredoc_inf(p) : NULL;
|
||||
|
||||
if (beg == 0) beg = -3; /* should never happen */
|
||||
if (end == 0) end = -3;
|
||||
newtok(p);
|
||||
while ((c = nextc(p)) != end || nest_level != 0) {
|
||||
if (hinf && (c == '\n' || c < 0)) {
|
||||
|
||||
Reference in New Issue
Block a user