Skip to content

Commit

Permalink
fix: Fix mem access error in strfind
Browse files Browse the repository at this point in the history
  • Loading branch information
romshark committed Mar 28, 2023
1 parent f995e1f commit 21c3479
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/strfind/strfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var safeCharSet = [256]byte{
// IndexTerm returns either -1 or the index of the string value terminator.
func IndexTerm[S []byte | string](s S, i int) (indexEnd int, errCode ErrCode) {
for j := 0; i < len(s); i++ {
if i+7 < len(s) {
if i+8 < len(s) {
if safeCharSet[s[i]] != 0 {
goto CHECK
}
Expand Down

0 comments on commit 21c3479

Please sign in to comment.