Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prevent double free for too big repetition quantifiers #13332

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

makenowjust
Copy link
Contributor

The previous implementation calls free(node) twice (on parsing and compiling a regexp) when it has an error, so it leads to a double-free issue. This PR enforces free(node) once by introducing a temporal pointer to hold parsing nodes.

The previous implement calls `free(node)` twice (on parsing and compiling a
regexp) when it has an error, so it leads a double-free issue. This
commit enforces `free(node)` once by introducing a temporal pointer to hold
parsing nodes.
@makenowjust makenowjust changed the title Prevent double-free for too big repetition quantifiers Prevent double free for too big repetition quantifiers May 14, 2025
Copy link

Tests Failed

✖️no tests failed ✔️61750 tests passed(1 flake)

@makenowjust makenowjust merged commit 35000ac into ruby:master May 16, 2025
80 of 81 checks passed
@makenowjust makenowjust deleted the fix/regexp-big-rep branch May 16, 2025 01:14
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.

1 participant