Change 23251 by davem@no-spam on 2004/09/01 22:17:47
[perl #31111] Random made scripts crashing perl
fix 'formline undef' coredump
Affected files ...
... //depot/perl/pp_ctl.c#403 edit
... //depot/perl/t/lib/warnings/9uninit#5 edit
Differences ...
==== //depot/perl/pp_ctl.c#403 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#402~23217~ Sat Aug 14 15:32:16 2004
+++ perl/pp_ctl.c Wed Sep 1 15:17:47 2004
@@no-spam -379,13 +379,16 @@no-spam
NV value;
bool gotsome = FALSE;
STRLEN len;
- STRLEN fudge = SvCUR(tmpForm) * (IN_BYTES ? 1 : 3) + 1;
+ STRLEN fudge = SvPOK(tmpForm)
+ ? (SvCUR(tmpForm) * (IN_BYTES ? 1 : 3) + 1) : 0;
bool item_is_utf8 = FALSE;
bool targ_is_utf8 = FALSE;
SV * nsv = Nullsv;
OP * parseres = 0;
char *fmt;
bool oneline;
+
+
if (!SvMAGICAL(tmpForm) || !SvCOMPILED(tmpForm)) {
if (SvREADONLY(tmpForm)) {
==== //depot/perl/t/lib/warnings/9uninit#5 (text) ====
Index: perl/t/lib/warnings/9uninit
--- perl/t/lib/warnings/9uninit#4~22802~ Fri May 7 12:12:29 2004
+++ perl/t/lib/warnings/9uninit Wed Sep 1 15:17:47 2004
@@no-spam -885,7 +885,8 @@no-spam
$v = sprintf $m1;
$v = sprintf '%d%d%d%d', $m1, $m2, $g1, $g2;
-eval {formline $m1 }; undef $m1;
+my $m3;
+eval {formline $m3 };
formline '@no-spam<<@no-spam<<@no-spam<<@no-spam<<', $m1, $m2, $g1, $g2;
EXPECT
Use of uninitialized value $m1 in sprintf at - line 5.
End of Patch.