Skip to content
Permalink
Browse files
HEREDOC could fail with NUL terminated lines; fix#3244
  • Loading branch information
matz committed Nov 11, 2016
1 parent e86ead4 commit 45aadd7e604c886ba7b96c69fa797a8e2937c711
Showing 1 changed file with 2 additions and 0 deletions.
@@ -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)) {

0 comments on commit 45aadd7

Please sign in to comment.