fix: sanitize filter targets to prevent fuzzy search panic on binary data#331
Open
Castrozan wants to merge 1 commit intosavedra1:mainfrom
Open
fix: sanitize filter targets to prevent fuzzy search panic on binary data#331Castrozan wants to merge 1 commit intosavedra1:mainfrom
Castrozan wants to merge 1 commit intosavedra1:mainfrom
Conversation
…data The sahilm/fuzzy library panics with 'index out of range' when the fuzzy matching algorithm encounters clipboard entries containing non-printable or binary data from copied images. This causes the TUI to crash when typing certain characters as the first filter character. Strip non-printable characters from filter targets before passing to the fuzzy search. This preserves full fuzzy matching behavior on the printable text content. Fixes savedra1#148
a2edf47 to
2ea7ccc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sahilm/fuzzylibrary panics withindex out of rangewhen it encounters non-ASCII/binary data in clipboard entries (typically from copied images)Context
Fix for #148. The root cause is in
sahilm/fuzzywhich doesn't handle all byte sequences safely. Rather than patching the dependency, we sanitize inputs withunicode.IsPrintbefore they reach the fuzzy matcher.Test plan
/to enter filter modea,f,g,i,t)