In In S_scan_heredoc(), avoid memNE() reading beyond the end of s.
authorNicholas Clark <nick@ccl4.org>
Mon, 25 Mar 2013 10:56:40 +0000 (11:56 +0100)
committerNicholas Clark <nick@ccl4.org>
Mon, 25 Mar 2013 16:34:31 +0000 (17:34 +0100)
commit6bf48f47bbdbe4838b70d67830ead4ebc3d318d4
tree469307d411e22c7a56ac6be801d32f25717d9ea9
parent621baac6f8d24886a415fe9240af154fccad42c7
In In S_scan_heredoc(), avoid memNE() reading beyond the end of s.

If the heredoc terminator we are searching for is longer than the bytes
remaining in s, then the memNE() would read beyond initialised memory.
Hence change the loop bounds to avoid this case, and change the failure case
below to reflect the revised end-of-loop condition.

It doesn't matter that the loop no longer increments shared->herelines,
because the failure case calls S_missingterm(), which croaks.
toke.c