[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Safe.pm and last LABEL
Is the following fixed in 5.8?
[Windows 95] C:\WINDOWS>perl -MSafe -wle "LOOP : { print 1; Safe->new->reval('last LOOP'); print 2 } print 3"
1
Exiting eval via last at (eval 2) line 2.
Exiting subroutine via last at (eval 2) line 2.
Exiting eval via last at (eval 2) line 2.
Exiting subroutine via last at (eval 2) line 2.
3
Can't return outside a subroutine.
If it's not fixed, how serious a security hole is it? I only happened
to come across someone writing an eval which I believed ought to have been
evaled inside a safe, and after reading Safe's docs, then Opcode's docs,
noticed that the "last" opcode is allowed in ":default", and wondered if
you could "last" out of a Safe.
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
- Follow-Ups from:
-
Rafael Garcia-Suarez <raphel.garcia-suarez@hexaflux.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]