From 9533c208863cfefde2af5227219ead61db00d207 Mon Sep 17 00:00:00 2001 From: Louis Gesbert Date: Mon, 12 Apr 2021 15:02:43 +0000 Subject: [PATCH] Fix index out of range in packetcache --- packetcache/packetcache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packetcache/packetcache.go b/packetcache/packetcache.go index d48eb33..ec974fb 100644 --- a/packetcache/packetcache.go +++ b/packetcache/packetcache.go @@ -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 {