Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from May 2, 2024

Conversation

tonycoz
Copy link
Contributor

@tonycoz tonycoz commented Apr 11, 2024

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

The reeproducer 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 Perl#21724
Copy link
Contributor

@leonerd leonerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leonerd leonerd merged commit 0d9e3bc into Perl:blead May 2, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syntax error provoking a core dump
2 participants