This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
study_chunk: honour mutate_ok over recursion
authorHugo van der Sanden <hv@crypt.org>
Tue, 28 Apr 2020 17:52:44 +0000 (18:52 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Mon, 1 Jun 2020 19:35:51 +0000 (20:35 +0100)
commit3a1df45e827a79d14694d18dd0141c09a0abfe5c
treedd73e954d63fe07d1c7a785dac9d022d9ccaa45b
parent0e9563b9242a5758c6ce11daf8385b3753e9ed9c
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)
embed.fnc
embed.h
proto.h
regcomp.c
t/re/pat.t