Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 3ca07e8

Browse files
committed
fix slice index overrun
1 parent 085a1a0 commit 3ca07e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

idx/memory/memory.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ func (m *UnpartitionedMemoryIdx) idsByTagQuery(orgId uint32, query TagQueryConte
12301230
func (m *UnpartitionedMemoryIdx) finalizeAutoCompleteResult(res []string, limit uint, deduplicate bool) []string {
12311231
sort.Strings(res)
12321232

1233-
if deduplicate {
1233+
if deduplicate && len(res) >= 2 {
12341234
j := 0
12351235
for i := 1; i < len(res); i++ {
12361236
if res[j] == res[i] {

0 commit comments

Comments
 (0)