From 672491e065771ff7ed0ad6965420cc449a68e67a Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Thu, 18 Feb 2016 11:58:00 -0800 Subject: [PATCH] Fix bug where we were returning a nil tree builder --- auditing.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/auditing.go b/auditing.go index 23cf675..01bbe3e 100644 --- a/auditing.go +++ b/auditing.go @@ -26,7 +26,10 @@ func VerifyConsistencyProof (proof ct.ConsistencyProof, first *ct.SignedTreeHead // nature of the tree; i.e. that the first tree is a "prefix" of the // second tree. If the first tree is empty, then it's trivially a prefix // of the second tree, so no proof is needed. - return len(proof) == 0, nil + if len(proof) != 0 { + return false, nil + } + return true, &MerkleTreeBuilder{stack: []ct.MerkleTreeNode{}, size: 0} } // Guaranteed that 0 < first.TreeSize < second.TreeSize