Skip to content

Commit

Permalink
Fixed unexpected behaviour of returning an index less than the length…
Browse files Browse the repository at this point in the history
… of the list when it comes to searching the list of bannedSignatures, due to slice ordering
  • Loading branch information
Michael Shi committed May 16, 2024
1 parent 1d52ce8 commit 0a05541
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ func IsSignatureBanned(signature string) bool {
defer bannedMutex.RUnlock()

for _, list := range bannedSignatures {
if sort.SearchStrings(list, signature) < len(list) {
return true
for _, entry := range list {
if entry == signature {
return true
}
}
}

Expand Down

0 comments on commit 0a05541

Please sign in to comment.