This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_formline(): avoid buffer overrun
authorDavid Mitchell <davem@iabyn.com>
Sat, 18 Feb 2017 10:20:00 +0000 (10:20 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 18 Feb 2017 10:20:00 +0000 (10:20 +0000)
commitf62fd06d790b3f8da5a193403a316ebbea86ba52
treed61bb244c0d25a3dee7d1d1681325a6bcd060691
parentc3d9aeb96afe725795daceaf39f6b133c0593328
pp_formline(): avoid buffer overrun

RT #130703

My recent commit v5.25.9-77-g90c3aa0 attempted to simplify buffer growth
in pp_formline(), but missed the operators which append data to
PL_formtarget *without* doing 'goto append'. These ops either append a
fieldsize's worth of bytes, or a \n (FF_NEWLINE). So grow by fieldsize
whenever we fetch something new, and for each FF_NEWLINE.
pp_ctl.c
t/op/write.t