diff options
author | Jens Hamisch <jens@Strawberry.COM> | 2000-10-30 16:17:07 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-31 14:20:08 +0000 |
commit | e38197b302fd8280036f3650932b6defd2b7e0cc (patch) | |
tree | cfd69fc0ddc2abaa6cb32f168a30fa030c0b8009 /av.c | |
parent | f90497d6ac1c2931ac3818605e3916039e91120c (diff) | |
download | perl-e38197b302fd8280036f3650932b6defd2b7e0cc.tar.gz |
[ID 20001030.001] 5.7.0-7489: Null-Pointer reference in mg.c
Message-Id: <20001030151707.A9597@Strawberry.COM>
p4raw-id: //depot/perl@7499
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -796,9 +796,14 @@ Perl_av_exists(pTHX_ AV *av, I32 key) if (SvRMAGICAL(av)) { if (mg_find((SV*)av,'P') || mg_find((SV*)av,'D')) { SV *sv = sv_newmortal(); + MAGIC *mg; + mg_copy((SV*)av, sv, 0, key); - magic_existspack(sv, mg_find(sv, 'p')); - return SvTRUE(sv); + mg = mg_find(sv, 'p'); + if (mg) { + magic_existspack(sv, mg); + return SvTRUE(sv); + } } } if (key <= AvFILLp(av) && AvARRAY(av)[key] != &PL_sv_undef |