diff options
author | Tony Cook <tony@develop-help.com> | 2010-06-17 18:58:04 +1000 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-17 23:47:19 -0700 |
commit | a7508b14cdf06d5140985f4fd9e1d79bd27efd10 (patch) | |
tree | 5a420c2eebb44449d07afb040ffc681a0a1f7876 /doio.c | |
parent | 81eebc3fbdd62475971a296b3d1dcc263232075e (diff) | |
download | perl-a7508b14cdf06d5140985f4fd9e1d79bd27efd10.tar.gz |
RT #75812: apply get magic before checking flags, PVX
The code was checking flags with applying any get magic, so when a
match was doing putting a numeric string into $1, none of the flags
checked were set, so producing the "non-numeric process ID" error.
(cherry picked from commit 8af710ebc7fee929ae47793d5a0cce5362af52db)
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1720,9 +1720,10 @@ nothing in the core. while (++mark <= sp) { I32 proc; register unsigned long int __vmssts; + SvGETMAGIC(*mark); if (!(SvIOK(*mark) || SvNOK(*mark) || looks_like_number(*mark))) Perl_croak(aTHX_ "Can't kill a non-numeric process ID"); - proc = SvIV(*mark); + proc = SvIV_nomg(*mark); APPLY_TAINT_PROPER(); if (!((__vmssts = sys$delprc(&proc,0)) & 1)) { tot--; @@ -1746,9 +1747,10 @@ nothing in the core. val = -val; while (++mark <= sp) { I32 proc; + SvGETMAGIC(*mark); if (!(SvIOK(*mark) || SvNOK(*mark) || looks_like_number(*mark))) Perl_croak(aTHX_ "Can't kill a non-numeric process ID"); - proc = SvIV(*mark); + proc = SvIV_nomg(*mark); APPLY_TAINT_PROPER(); #ifdef HAS_KILLPG if (PerlProc_killpg(proc,val)) /* BSD */ @@ -1761,9 +1763,10 @@ nothing in the core. else { while (++mark <= sp) { I32 proc; + SvGETMAGIC(*mark); if (!(SvIOK(*mark) || SvNOK(*mark) || looks_like_number(*mark))) Perl_croak(aTHX_ "Can't kill a non-numeric process ID"); - proc = SvIV(*mark); + proc = SvIV_nomg(*mark); APPLY_TAINT_PROPER(); if (PerlProc_kill(proc, val)) tot--; |