From: me-01@ton.iguana.be Date: Wed, 12 Sep 2001 14:11:16 +0000 (+0000) Subject: [ID 20010912.007] substr reference core dump X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9bf12eaf439552772b53d65e2dd335097dac1a84;p=p5sagit%2Fp5-mst-13.2.git [ID 20010912.007] substr reference core dump Message-Id: <20010912141116.6058.qmail@quasar.home.lunix> p4raw-id: //depot/perl@12005 --- diff --git a/mg.c b/mg.c index 9def37f..3de4420 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);