Merge pull request #13681 from AdamKorcz/fuzz5

server/storage/mvcc: fix oss-fuzz issue 44449
This commit is contained in:
Marek Siarkowicz 2022-02-13 19:35:21 +01:00 committed by GitHub
commit bdb13e2e12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,8 +257,14 @@ func (ti *treeIndex) Equal(bi index) bool {
equal := true
ti.tree.Ascend(func(item btree.Item) bool {
aki := item.(*keyIndex)
bki := b.tree.Get(item).(*keyIndex)
var aki, bki *keyIndex
var ok bool
if aki, ok = item.(*keyIndex); !ok {
return false
}
if bki, ok = b.tree.Get(item).(*keyIndex); !ok {
return false
}
if !aki.equal(bki) {
equal = false
return false