From a803faadd71d3d65e6251c8ba9de4c7ca1005923 Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 2 Nov 2022 13:06:47 -0400 Subject: [PATCH] shachain: use maxHeight+1 for bucket key space This prevents a nil-pointer-dereference if we hit 2^48 channel states. --- shachain/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shachain/store.go b/shachain/store.go index 252abdfeb..6409adb3b 100644 --- a/shachain/store.go +++ b/shachain/store.go @@ -46,7 +46,7 @@ type RevocationStore struct { // buckets is an array of elements from which we may derive all // previous elements, each bucket corresponds to the element with the // particular number of trailing zeros. - buckets [maxHeight]element + buckets [maxHeight + 1]element // index is an available index which will be assigned to the new // element.