Skip to content

Commit

Permalink
after reading a too long line, restart at the beginning of the buffer so
Browse files Browse the repository at this point in the history
we don't keep writing past the end. (the perils of trying to recover from
parse errors.)
noticed by Jan Schreiber
  • Loading branch information
tedu authored and Duncaen committed Jan 28, 2021
1 parent 36cc28e commit 01ac841
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,10 @@ repeat:
}
}
*p++ = c;
if (p == ebuf)
if (p == ebuf) {
yyerror("too long line");
p = buf;
}
escape = 0;
}

Expand Down

0 comments on commit 01ac841

Please sign in to comment.