diff options
author | Hugo van der Sanden <hv@crypt.org> | 2020-04-28 18:52:44 +0100 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2020-06-01 20:35:51 +0100 |
commit | 3a1df45e827a79d14694d18dd0141c09a0abfe5c (patch) | |
tree | dd73e954d63fe07d1c7a785dac9d022d9ccaa45b /proto.h | |
parent | 0e9563b9242a5758c6ce11daf8385b3753e9ed9c (diff) | |
download | perl-3a1df45e827a79d14694d18dd0141c09a0abfe5c.tar.gz |
study_chunk: honour mutate_ok over recursion
As described in #17743, study_chunk can re-enter itself either by
simple recursion or by enframing. 089ad25d3f used the new mutate_ok
variable to track whether we were within the framing scope of GOSUB,
and to disallow mutating changes to ops if so.
This commit extends that logic to reentry by recursion, passing in
the current state as was_mutate_ok.
(CVE-2020-12723)
(cherry picked from commit 3445383845ed220eaa12cd406db2067eb7b8a741)
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5934,7 +5934,7 @@ STATIC void S_ssc_or(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc, co STATIC void S_ssc_union(pTHX_ regnode_ssc *ssc, SV* const invlist, const bool invert_2nd); #define PERL_ARGS_ASSERT_SSC_UNION \ assert(ssc); assert(invlist) -STATIC SSize_t S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, SSize_t *minlenp, SSize_t *deltap, regnode *last, struct scan_data_t *data, I32 stopparen, U32 recursed_depth, regnode_ssc *and_withp, U32 flags, U32 depth); +STATIC SSize_t S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, SSize_t *minlenp, SSize_t *deltap, regnode *last, struct scan_data_t *data, I32 stopparen, U32 recursed_depth, regnode_ssc *and_withp, U32 flags, U32 depth, bool was_mutate_ok); #define PERL_ARGS_ASSERT_STUDY_CHUNK \ assert(pRExC_state); assert(scanp); assert(minlenp); assert(deltap); assert(last) #endif |