Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 524 forks source link

perly LSTOPSUB: prevent a double op free between parse stack and CV #22134

Open tonycoz opened 3 weeks ago

tonycoz commented 3 weeks ago

The reproducer resulted in the "block" OP being both on the parser stack and attacked to the CV. If an error occurred while parsing the rest of the list operator clean up would release the OP as attached to the CV, and the same OP on the parse stack, resulting in a double free.

It's unclear to me whether bison is intended to support modifying the parse stack entry like this, but it appears to work here.

Fixes #21724