Skip to content

fix(localfile): reject invalid grep patterns instead of panicking - #632

Merged
sfc-gh-ikryvanos merged 3 commits into
mainfrom
fix/localfile-grep-invalid-regex
Aug 27, 2026
Merged

fix(localfile): reject invalid grep patterns instead of panicking#632
sfc-gh-ikryvanos merged 3 commits into
mainfrom
fix/localfile-grep-invalid-regex

Conversation

@sfc-gh-ikryvanos

Copy link
Copy Markdown
Collaborator

Read compiled the caller-supplied grep expression with regexp.MustCompile, so a malformed pattern panicked and crashed the server. Compile the pattern with regexp.Compile and return InvalidArgument on failure. Adds a regression test for a non-compilable pattern.

Read compiled the caller-supplied grep expression with regexp.MustCompile,
so a malformed pattern panicked and crashed the server. Compile the pattern
with regexp.Compile and return InvalidArgument on failure. Adds a
regression test for a non-compilable pattern.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sfc-gh-ikryvanos
sfc-gh-ikryvanos enabled auto-merge (squash) August 27, 2026 09:41
@sfc-gh-ikryvanos
sfc-gh-ikryvanos merged commit e3cb4ec into main Aug 27, 2026
7 checks passed
@sfc-gh-ikryvanos
sfc-gh-ikryvanos deleted the fix/localfile-grep-invalid-regex branch August 27, 2026 12:57
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