summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorme-01@ton.iguana.be <me-01@ton.iguana.be>2001-09-12 14:11:16 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-12 13:14:59 +0000
commit9bf12eaf439552772b53d65e2dd335097dac1a84 (patch)
tree696fef3e90374af49d239b010912df80778d9ec2 /mg.c
parent8caf10e04806e201590b4a28a78a0ad3f0df5851 (diff)
downloadperl-9bf12eaf439552772b53d65e2dd335097dac1a84.tar.gz
[ID 20010912.007] substr reference core dump
Message-Id: <20010912141116.6058.qmail@quasar.home.lunix> p4raw-id: //depot/perl@12005
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index 9def37f10b..3de4420c3e 100644
--- a/mg.c
+++ b/mg.c
@@ -1506,7 +1506,7 @@ Perl_magic_setsubstr(pTHX_ SV *sv, MAGIC *mg)
sv_insert(lsv, lvoff, lvlen, tmps, len);
SvUTF8_on(lsv);
}
- else if (SvUTF8(lsv)) {
+ else if (lsv && SvUTF8(lsv)) {
sv_pos_u2b(lsv, &lvoff, &lvlen);
tmps = (char*)bytes_to_utf8((U8*)tmps, &len);
sv_insert(lsv, lvoff, lvlen, tmps, len);