summaryrefslogtreecommitdiff
path: root/scope.h
diff options
context:
space:
mode:
authorReini Urban <rurban@x-ray.at>2012-05-29 15:46:13 -0500
committerFather Chrysostomos <sprout@cpan.org>2012-05-29 14:55:19 -0700
commit014243a274e5fe909b0735ff5f198a4edc5f35c4 (patch)
treee36848f8a6e1b2dcfaa6f5255a46e4bdc960e340 /scope.h
parent1b08e05188c16b744b6f2b0e2a2321db606eb88d (diff)
downloadperl-014243a274e5fe909b0735ff5f198a4edc5f35c4.tar.gz
[perl #113060] Save cop_stashlen threaded even with shared cop pv
Perl_sv_compile_2op_is_broken() does at line 3354 a LEAVE_with_name("eval"), a SSPOPSTR via SAVEt_SHARED_PVREF for the localized cop_stashpv, but not for the cop_stashlen. The cop in question is PL_compiling, which was "AutoSplit" before with len=9 and restores it back to "main" but keeps len 9. Thus leading to a heap-overflow in gv_stashpvn.
Diffstat (limited to 'scope.h')
-rw-r--r--scope.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/scope.h b/scope.h
index aa04a792c5..38da244169 100644
--- a/scope.h
+++ b/scope.h
@@ -237,7 +237,8 @@ scope has the given name. Name must be a literal string.
#ifdef USE_ITHREADS
# define SAVECOPSTASH(c) (SAVEPPTR(CopSTASHPV(c)), \
SAVEI32(CopSTASH_len(c)))
-# define SAVECOPSTASH_FREE(c) SAVESHAREDPV(CopSTASHPV(c))
+# define SAVECOPSTASH_FREE(c) (SAVESHAREDPV(CopSTASHPV(c)), \
+ SAVEI32(CopSTASH_len(c)))
# define SAVECOPFILE(c) SAVEPPTR(CopFILE(c))
# define SAVECOPFILE_FREE(c) SAVESHAREDPV(CopFILE(c))
#else