-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/bank/types: fix AddressFromBalancesStore panics with invalid keys #9061
x/bank/types: fix AddressFromBalancesStore panics with invalid keys #9061
Conversation
cc @odeke-em |
Codecov Report
@@ Coverage Diff @@
## master #9061 +/- ##
==========================================
- Coverage 58.95% 58.95% -0.01%
==========================================
Files 574 574
Lines 32213 32220 +7
==========================================
+ Hits 18992 18996 +4
- Misses 11002 11004 +2
- Partials 2219 2220 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @cuonglm! I've filed an issue for it #9062, so please update the commit message and also the message on the PR to indicate a Fixes #NNNN
/cc @marbar3778 @alessio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking for now. Would like to avoid manipulating sdk.AccAddress(0x00)
.
@cuonglm, let’s just panic and test that we panic on bad inputs and then
lock that in. Thanks @AmauryM for the input, and great point about avoid
0x00 as an address.
…On Wed, Apr 7, 2021 at 4:34 AM Amaury ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Blocking for now. Would like to avoid manipulating sdk.AccAddress(0x00).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9061 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFL3VY7Q6WD7BUMNV66JATTHQ7KVANCNFSM42QEIMTA>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
Description
Currently, AddressFromBalancesStore uses the input key without any
validation, so an empty key or an invalid key length cause it panics.
This commit fixes the problem, by introducing new InvalidKey type, which
will be returned to the caller when an invalid key was passed.
Found by fuzzing added in #9060.
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes