Skip to content
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

[5.0.x] Safety: check length during deserialization #3549

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

jaspervdm
Copy link
Contributor

Investigation into mimblewimble/grin-wallet#576 led me to the secp_ser code, where we attempt to take a byte slice of length 32. If the original vec is shorter, attempting to take a slice of that length will result in a panic. To prevent this we should first check the length of the vector and return an error if its too short.

We do something similar in 2 other places so I decided to fix those too.

Copy link
Member

@quentinlesceller quentinlesceller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Can you port it to master too?

@jaspervdm jaspervdm merged commit b7a9f7b into mimblewimble:current/5.0.x Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants