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

[cbor] Overflow when decoding uint32 for Major type 0 #30

Closed
cowtowncoder opened this issue Oct 11, 2016 · 3 comments
Closed

[cbor] Overflow when decoding uint32 for Major type 0 #30

cowtowncoder opened this issue Oct 11, 2016 · 3 comments
Labels
Milestone

Comments

@cowtowncoder
Copy link
Member

(moved from jackson-dataformat-cbor, by @TianlinZhou)


When decoding unit32 that is larger than 2^31 - 1, overflow will happen.
For example, decoding "1a 8a e8 08 f1" will get -1964504847, but it should be 2330462449.

@cowtowncoder
Copy link
Member Author

@TianlinZhou I may need some help here, can not quite reproduce the problem with 2.8.4.

@cowtowncoder
Copy link
Member Author

Actually, never mind, got it. While Jackson itself never writes such values (which is also why no unit tests noticed this issue), I can manually construct such input value.

@cowtowncoder cowtowncoder added this to the 2.8.5 milestone Oct 15, 2016
@cowtowncoder cowtowncoder removed the 2.9 label Oct 15, 2016
@cowtowncoder
Copy link
Member Author

Was able to fix this and related cases (int64 has similar issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant