From 2c08967d7ab1e5f8f94a074e5520cd21d33df9d7 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Thu, 29 Aug 2024 14:52:35 +0200 Subject: [PATCH] fix: prevent out of bounds on lookup inners access --- go/compress.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/go/compress.go b/go/compress.go index 173e7c87..d1d7f790 100644 --- a/go/compress.go +++ b/go/compress.go @@ -153,7 +153,9 @@ func decompressExist(exist *CompressedExistenceProof, lookup []*InnerOp) *Existe Path: make([]*InnerOp, len(exist.Path)), } for i, step := range exist.Path { - res.Path[i] = lookup[step] + if int(step) < len(lookup) { + res.Path[i] = lookup[step] + } } return res }