From 722118ade9efdcca6f1d120fb43c25daf86fd3c9 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 14 May 2019 15:26:50 +0100 Subject: [PATCH] Add range check on height extracted from coinbase script --- parser/block.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parser/block.go b/parser/block.go index c12baa3..b4cf215 100644 --- a/parser/block.go +++ b/parser/block.go @@ -70,6 +70,9 @@ func (b *block) GetHeight() int { return -1 } // uint32 should last us a while (Nov 2018) + if heightNum > int64(^uint32(0)) { + return -1 + } blockHeight := uint32(heightNum) if blockHeight == genesisTargetDifficulty {