You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…9112)
addrLen is encoded in a byte, so it's an uint8. The code in
AddressFromBalancesStore cast it to int for bound checking, but wrongly uses "addrLen+1", which can be overflow.
To fix this, just cast addrLen once and use it in all places.
Found by fuzzing added in #9060.
Fixes#9111
Summary of Bug
Coming here from #9060, the current address length checking condition in AddressFromBalancesStore has false positive:
cosmos-sdk/x/bank/types/key.go
Line 47 in 849fab1
First, we check for
len(key[1:]) < int(addrLen)
, but later, we do slice slicing withkey[1 : addrLen+1]
.The problem is that
addrLen
is encoded in a byte, soaddrLen+1
can be overflow. It seems to me that we can fix this by using `int(addrLen)+1 instead.Version
All versions.
Steps to Reproduce
For Admin Use
The text was updated successfully, but these errors were encountered: