Skip to content

Handle all cachekey regex capture groups - #13653

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:cachekey-capture-overflow
Open

Handle all cachekey regex capture groups#13653
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:cachekey-capture-overflow

Conversation

@bneradt

@bneradt bneradt commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Cachekey patterns with ten or more capture groups can crash ATS when
building a cache key because a successful match leaves the capture
vector empty. Replacement patterns also reject valid group references
when the default match buffer is too small.

This patch sizes match buffers for the complete pattern, uses the
available match count, and rejects empty capture results before
iteration. Replay coverage verifies complete cache keys across the
capture limit and preserves replacement and no-match behavior.

Fixes: #13638

Co-authored-by: GPT-6 Astra Light

Cachekey patterns with ten or more capture groups can crash ATS when
building a cache key because a successful match leaves the capture
vector empty. Replacement patterns also reject valid group references
when the default match buffer is too small.

This patch sizes match buffers for the complete pattern, uses the
available match count, and rejects empty capture results before
iteration. Replay coverage verifies complete cache keys across the
capture limit and preserves replacement and no-match behavior.

Fixes: apache#13638

Co-authored-by: GPT-6 Astra Light
Copilot AI lite review requested due to automatic review settings September 8, 2026 22:46
@bneradt bneradt added this to the 11.0.0 milestone Sep 8, 2026
@bneradt bneradt self-assigned this Sep 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@bneradt bneradt added cachekey cachekey plugin and removed AuTest labels Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

cachekey: Pattern::capture() can return true with an empty vector, and Pattern::process() reads past the end

2 participants