diff options
author | M. J. T. Guy <mjtg@cus.cam.ac.uk> | 2000-07-18 12:30:16 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-07-24 01:54:54 +0000 |
commit | 73396e077e98f6642c85f22af0d45fb838622755 (patch) | |
tree | 6b49cf2972b26666c98920fb946c21e0000f1372 /lib/File | |
parent | f783e543405e385e83071e07bc094a11898d550a (diff) | |
download | perl-73396e077e98f6642c85f22af0d45fb838622755.tar.gz |
Protect against "wild next"s, that is, callbacks doing "next"
instead of "return".
Subject: [PATCH] Re: [ID 20000717.003] Core dump in 5.6.0
Message-Id: <E13EUdk-0006ha-00@libra.cus.cam.ac.uk>
p4raw-id: //depot/perl@6423
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/Find.pm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/File/Find.pm b/lib/File/Find.pm index f803c15d51..a9f190c722 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -373,7 +373,7 @@ sub _find_opt { $name = $abs_dir . $_; - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" } @@ -429,7 +429,7 @@ sub _find_dir($$$) { $_= ($no_chdir ? $dir_name : $dir_rel ); # prune may happen here $prune= 0; - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" next if $prune; } @@ -472,7 +472,7 @@ sub _find_dir($$$) { $name = $dir_pref . $FN; $_ = ($no_chdir ? $name : $FN); - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" } } @@ -496,13 +496,13 @@ sub _find_dir($$$) { else { $name = $dir_pref . $FN; $_= ($no_chdir ? $name : $FN); - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" } } else { $name = $dir_pref . $FN; $_= ($no_chdir ? $name : $FN); - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" } } } @@ -528,7 +528,7 @@ sub _find_dir($$$) { if ( substr($_,-2) eq '/.' ) { s|/\.$||; } - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" } else { push @Stack,[$CdLvl,$p_dir,$dir_rel,-1] if $bydepth; last; @@ -602,7 +602,7 @@ sub _find_dir_symlnk($$$) { # prune may happen here $prune= 0; lstat($_); # make sure file tests with '_' work - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" next if $prune; } @@ -652,7 +652,7 @@ sub _find_dir_symlnk($$$) { $fullname = $new_loc; $name = $dir_pref . $FN; $_ = ($no_chdir ? $name : $FN); - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" } } @@ -686,7 +686,7 @@ sub _find_dir_symlnk($$$) { } lstat($_); # make sure file tests with '_' work - &$wanted_callback; + { &$wanted_callback }; # protect against wild "next" } else { push @Stack,[$dir_loc, $pdir_loc, $p_dir, $dir_rel,-1] if $bydepth; last; |