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