diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-01-19 23:41:37 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-01-19 23:41:37 +0000 |
commit | 1bf2966364b6356e9050b17d8920dd4a8ce27d97 (patch) | |
tree | 59c593eabb42816327b7d1084be6074b9bf435a9 /mg.c | |
parent | d0a21e0008d063055a75cb0839423bc677ec5a5a (diff) | |
download | perl-1bf2966364b6356e9050b17d8920dd4a8ce27d97.tar.gz |
change #22071 (taint bug in $^0) introduced a potential double
free(), because PL_osname may get freed but not nulled if a taint
test fails in between. Mea cupla and all that...
p4raw-link: @22071 on //depot/perl: 3511154c18a0900e8873e8e72a4b74931525e718
p4raw-id: //depot/perl@22181
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2091,14 +2091,14 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) break; case '\017': /* ^O */ if (*(mg->mg_ptr+1) == '\0') { - if (PL_osname) + if (PL_osname) { Safefree(PL_osname); + PL_osname = Nullch; + } if (SvOK(sv)) { TAINT_PROPER("assigning to $^O"); PL_osname = savepv(SvPV(sv,len)); } - else - PL_osname = Nullch; } else if (strEQ(mg->mg_ptr, "\017PEN")) { if (!PL_compiling.cop_io) |