fix: Merkle tree proof length check (#1432)

This commit is contained in:
Giuliano Mega 2026-06-16 15:14:17 -03:00 committed by GitHub
parent c4a92b3d11
commit aee1398836
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,7 +65,7 @@ func verify*(self: StorageMerkleProof, leaf: MultiHash, root: MultiHash): ?!bool
if self.mcodec != root.mcodec or self.mcodec != leaf.mcodec:
return failure "Hash codec mismatch"
if rootBytes.len != root.size and leafBytes.len != leaf.size:
if rootBytes.len != root.size or leafBytes.len != leaf.size:
return failure "Invalid hash length"
self.verify(leafBytes, rootBytes)