1
Fork 0

Fix index out of range in packetcache

This commit is contained in:
Louis Gesbert 2021-04-12 15:02:43 +00:00 committed by Juliusz Chroboczek
parent 050804b93a
commit 9533c20886
1 changed files with 1 additions and 1 deletions

View File

@ -412,7 +412,7 @@ func (cache *Cache) GetAt(seqno uint16, index uint16, result []byte) uint16 {
cache.mu.Lock() cache.mu.Lock()
defer cache.mu.Unlock() defer cache.mu.Unlock()
if int(index) > len(cache.entries) { if int(index) >= len(cache.entries) {
return 0 return 0
} }
if cache.entries[index].seqno != seqno { if cache.entries[index].seqno != seqno {