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

Add slice range checks to UnmarshalBinary(). #232

Merged
merged 2 commits into from Jun 22, 2021
Merged

Add slice range checks to UnmarshalBinary(). #232

merged 2 commits into from Jun 22, 2021

Conversation

jmalloc
Copy link
Contributor

@jmalloc jmalloc commented Jun 10, 2021

This PR adds range checks to Decimal.UnmarshalBinary(), which prior to this PR would panic if data was less than 4 bytes in length.

For symmetry with other methods and this new error I've also added a little extra context to the error returned by GobDecode(), to make it clear it occurred within UnmarshalBinary().

This addresses #231.

Copy link
Member

@mwoss mwoss left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for your contribution! :D

@mwoss mwoss merged commit cc4584f into shopspring:master Jun 22, 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.

None yet

2 participants