-
Notifications
You must be signed in to change notification settings - Fork 107
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(network messages): add limits to rejection message and reason #4687
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4687 +/- ##
==========================================
- Coverage 78.93% 78.82% -0.12%
==========================================
Files 304 304
Lines 37506 37523 +17
==========================================
- Hits 29604 29576 -28
- Misses 7902 7947 +45 |
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.
Looks great!
We could merge this like it is, but it increases the risk of memory denial of service, and there is an easy fix for that.
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.
Let's merge after the release
Motivation
Zcash limits the rejection message and the reason to specific constants. We want to do similar for Zebra.
Close #4632
Depends-On: #4714
Solution
Add constants and truncate
Mesage::Reject::message
toMAX_REJECT_MESSAGE_LENGTH
andMesage::Reject::reason
toMAX_REJECT_REASON_LENGTH
Review
I think anyone can review, i left some comments with references to zcashd.
Reviewer Checklist