Skip to content

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

Open
sfc-gh-ikryvanos wants to merge 1 commit into
mainfrom
fix/localfile-grep-invalid-regex
Open

fix(localfile): reject invalid grep patterns instead of panicking#632
sfc-gh-ikryvanos wants to merge 1 commit 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>
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