1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 02:05:59 +01:00

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

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 {