-
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
fix(x/distribution): vulnerable incrementReferenceCount in distribution #19301
Changes from all commits
0580ff9
073cae1
7086c09
1147f97
1c2ad0d
74f8068
6194378
c319021
fb0b0d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,10 +124,11 @@ func (k Keeper) incrementReferenceCount(ctx context.Context, valAddr sdk.ValAddr | |
if err != nil { | ||
return err | ||
} | ||
|
||
historical.ReferenceCount++ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation of the panic condition when the reference count exceeds 2 in the |
||
if historical.ReferenceCount > 2 { | ||
panic("reference count should never exceed 2") | ||
} | ||
historical.ReferenceCount++ | ||
return k.ValidatorHistoricalRewards.Set(ctx, collections.Join(valAddr, period), historical) | ||
} | ||
|
||
Comment on lines
124
to
134
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The call to |
||
|
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.
The changelog entry for the bug fix is correctly formatted, follows the guiding principles, and includes the appropriate PR link. However, it lacks detail about the nature of the vulnerability and how it was fixed. Consider adding a brief description of the vulnerability and the fix applied for better clarity.