scan_heredoc could reallocate PL_parser->linestr's PV
authorDavid Leadbeater <dgl@dgl.cx>
Sat, 14 May 2011 12:57:21 +0000 (13:57 +0100)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 19 May 2011 05:20:43 +0000 (22:20 -0700)
commit37c6a70c7d35357916da21616c68e56c878a5bd2
treefe7ab7c9ee4892844640e97226a3f17709389ad0
parentea74ff717a4ba16fc7b858acd65cc2c893970c30
scan_heredoc could reallocate PL_parser->linestr's PV

Since f0e67a1 it was possible the freed buffer may be read from when
parsing a heredoc. This adds a call to lex_grow_linestr to grow the
buffer and ensure the pointers in PL_parser are updated.

The bug is pretty hard to reproduce, hence no test. I'm able to
reproduce it with the following:

  perl -Meverywhere=re,debug -MParams::Util -e1
toke.c