x/bank/types: (Balance).GetAddress ignores error and returns zero value if invalid #8530
Closed
Description
opened on Feb 6, 2021
Summary of Bug
Noticed while auditing PR #8421 for the sake of Stargate release security, that this code
cosmos-sdk/x/bank/types/balance.go
Lines 17 to 20 in c5c049a
Sure there is some different code path that actually checks the error when (Balance).Validate is invoked, but that's a code smell because many will forget to invoke (Balance).Validate() and even then those code paths re-do a bunch of work
Suggestion
We should always validate such a code path
For Admin Use
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged
- Contributor assigned/self-assigned
Activity