summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-09-01 22:17:47 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-09-01 22:17:47 +0000
commit24c897388d7b9ce07248cecb5920b9fbd4ac27ba (patch)
tree632dcbda065a40f7ec33a344d6797421ef38f196 /pp_ctl.c
parentfd1abbef24b103836b91c31da66323dac8ca6b23 (diff)
downloadperl-24c897388d7b9ce07248cecb5920b9fbd4ac27ba.tar.gz
[perl #31111] Random made scripts crashing perl
fix 'formline undef' coredump p4raw-id: //depot/perl@23251
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index f07d7162b8..52603c242f 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -379,7 +379,8 @@ PP(pp_formline)
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;
@@ -387,6 +388,8 @@ PP(pp_formline)
char *fmt;
bool oneline;
+
+
if (!SvMAGICAL(tmpForm) || !SvCOMPILED(tmpForm)) {
if (SvREADONLY(tmpForm)) {
SvREADONLY_off(tmpForm);