lexer: Fix buffer overread in journaling when source does not end in \n.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 29 Sep 2018 22:43:39 +0000 (15:43 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 29 Sep 2018 22:44:02 +0000 (15:44 -0700)
commitb4f585e70eca236ca97e53ef487cea9a3ab5e78a
treeaa086bd793d6040c85d1f7058fd3aff798c7a012
parent08485153588c93cc83e4d65ab58460467250f0fe
lexer: Fix buffer overread in journaling when source does not end in \n.

An earlier commit removed the requirement that a source file ends in \n,
but the lexer still made that assumption.  This is intended to fix the
problem.  (Probably, some new tests should be added.)

Thanks to John Darrington for reporting the problem.

Fixes: e0f9210e814d ("lexer: Add support for embedded \0 bytes and missing trailing new-line.")
src/language/lexer/lexer.c