diff options
author | Andrew Pimlott <pimlott@idiomtech.com> | 2000-10-04 17:57:43 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-04 23:14:01 +0000 |
commit | 3887d568fc17eb8ca8b2dcf68e729c1ce7e5e6a5 (patch) | |
tree | 412c8a75d8bb71f9e11d2080b1c472b66b5fe941 /pp_hot.c | |
parent | b35c5fa1ef4ed5bc851a2c97d645858aa9d0f736 (diff) | |
download | perl-3887d568fc17eb8ca8b2dcf68e729c1ce7e5e6a5.tar.gz |
Fix for
Subject: [ID 20001004.006] undef is never tainted
Message-Id: <m13h0I3-000SEmC@nolfolan.idiomtech.com>
An undef read from a slurped file was not tainted.
p4raw-id: //depot/perl@7549
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -1450,6 +1450,13 @@ Perl_do_readline(pTHX) offset = 0; } + /* This should not be marked tainted if the fp is marked clean */ +#define MAYBE_TAINT_LINE(io, sv) \ + if (!(IoFLAGS(io) & IOf_UNTAINT)) { \ + TAINT; \ + SvTAINTED_on(sv); \ + } + /* delay EOF state for a snarfed empty file */ #define SNARF_EOF(gimme,rs,io,sv) \ (gimme != G_SCALAR || SvCUR(sv) \ @@ -1478,13 +1485,10 @@ Perl_do_readline(pTHX) (void)SvOK_off(TARG); PUSHTARG; } + MAYBE_TAINT_LINE(io, sv); RETURN; } - /* This should not be marked tainted if the fp is marked clean */ - if (!(IoFLAGS(io) & IOf_UNTAINT)) { - TAINT; - SvTAINTED_on(sv); - } + MAYBE_TAINT_LINE(io, sv); IoLINES(io)++; IoFLAGS(io) |= IOf_NOLINE; SvSETMAGIC(sv); |