summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2021-02-09 01:11:30 +0000
committerPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2021-02-09 01:11:38 +0000
commitd4c0efc5ecf8e55dc836384c26ca7ba29689caf4 (patch)
treeab0bcc4f7a08bae796d6c96cb7b2ad1f7b266950 /op.c
parent4ba80ef4d6196579c7914cb88df2e8ca3595224a (diff)
downloadperl-d4c0efc5ecf8e55dc836384c26ca7ba29689caf4.tar.gz
Avoid read-after-free of o->op_flags in Perl_ck_eval()
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/op.c b/op.c
index e507d32446..cff984d093 100644
--- a/op.c
+++ b/op.c
@@ -12747,13 +12747,14 @@ Perl_ck_eval(pTHX_ OP *o)
if (o->op_type == OP_ENTERTRY) {
LOGOP *enter;
+ U8 flags = o->op_flags;
/* cut whole sibling chain free from o */
op_sibling_splice(o, NULL, -1, NULL);
op_free(o);
enter = alloc_LOGOP(OP_ENTERTRY, NULL, NULL);
- if(o->op_flags & OPf_SPECIAL)
+ if(flags & OPf_SPECIAL)
enter->op_flags |= OPf_SPECIAL;
/* establish postfix order */