summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-12 12:55:21 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-12 12:55:59 -0800
commit3f12cff414d1c6ec878a7e1a4ed270a421a8a75e (patch)
treee683d17d246a62dc3e6a37ce6a3973d2d7560fed /pp_sys.c
parenta289ef89aea304cdebfa085e4451b1c02cb33648 (diff)
downloadperl-3f12cff414d1c6ec878a7e1a4ed270a421a8a75e.tar.gz
In pp_sys.c:pp_fttext, don’t call cGVOP_gv on an UNOP
Otherwise we might get a crash. cGVOP_gv is only valid when the OPf_REF flag is set. In either case, gv already holds the GV we want anyway. This code has been buggy this way since this commit: commit 5f05dabc4054964aa3b10f44f8468547f051cdf8 Author: Perl 5 Porters <perl5-porters@africa.nicoh.com> Date: Thu Dec 19 16:44:00 1996 +1200 [inseparable changes from patch from perl5.003_11 to perl5.003_12] but apparently has not actually caused a crash until just now. I was trying to add a test for another bug (fixed in the next commit), and it happened to trigger this one. My attempt to reduce this to something small and reproducible failed.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 71c5ca741d..e9958b38b3 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3351,7 +3351,7 @@ PP(pp_fttext)
len = 512;
}
else {
- report_evil_fh(cGVOP_gv);
+ report_evil_fh(gv);
SETERRNO(EBADF,RMS_IFI);
RETPUSHUNDEF;
}