Skip to content

reject out-of-range quantifier counts in RegexParser#64

Open
aizu-m wants to merge 1 commit into
apache:trunkfrom
aizu-m:regex-quantifier-overflow
Open

reject out-of-range quantifier counts in RegexParser#64
aizu-m wants to merge 1 commit into
apache:trunkfrom
aizu-m:regex-quantifier-overflow

Conversation

@aizu-m

@aizu-m aizu-m commented Jun 20, 2026

Copy link
Copy Markdown

the {min,max} loop in parseFactor accumulates the count in an int but only checks for a negative wrap afterwards, so a value like a{4294967296} slips past as a{0} (matching the empty string) and a{99999999999} exhausts the heap when matched; guard against the overflow before the multiply so an out-of-range count throws the parser.quantifier.5 it was always meant to.

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