Skip to content

[6.4] Handle excessively-nested custom char classes - #915

Open
natecook1000 wants to merge 1 commit into
release/6.4.xfrom
fix/6.4-nested-ccs
Open

natecook1000 wants to merge 1 commit into
release/6.4.xfrom
fix/6.4-nested-ccs

Conversation

@natecook1000

Copy link
Copy Markdown
Member

Cherry pick of #912 for the release/6.4.x branch.

  • Explanation: Just like with groups, excessively nested custom character classes over-recurse and can lead to a stack overflow. This change adds the same depth limit to CCCs as groups.
  • Issue: rdar://113220839
  • Scope: Very narrow: this adds validation for nesting depth for patterns that previously would have overflowed the stack.
  • Risk: Very low: change is limited to regex compilation.
  • Testing: New and existing unit tests.
  • Reviewed by: @stephentyrone

Just like with groups, excessively nested custom character classes
over-recurse and can lead to a stack overflow. This adds the same
depth limit to CCCs as groups.

rdar://113220839
@natecook1000 natecook1000 changed the title Handle excessively-nested custom char classes [6.4] Handle excessively-nested custom char classes Oct 28, 2026
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.

2 participants