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
UnmarshalBinary() panics if slice is not expected length. #231
Comments
No problem. Thanks for submitting the fresh PR :D |
@jmalloc I've merged your PR a moment ago, it looks really great. Thanks a lot for your contribution! :3 |
Excellent, thanks! I look forward to a new patch release ;) |
I noticed this is tagged in 1.3.0, thanks! |
I've just encountered a panic when testing invalid input to
UnmarshalBinary()
, due to the fact it access a subslice ofdata
without doing any length checks (see https://github.com/shopspring/decimal/blob/master/decimal.go#L1156).I suspect it should return an error instead, otherwise the user needs to understand the internal details of the binary format to validate this input before calling
UnmarshalBinary()
.The text was updated successfully, but these errors were encountered: