Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@egv
Copy link

@egv egv commented Aug 12, 2014

on android I had problems with negative-size arrays, this fixes them

on android I had problems with negative-size arrays, this fixes them
@frsyuki
Copy link
Member

frsyuki commented Aug 12, 2014

I think it should throw SizeLimitException rather than faking the length because using wrong length may return broken value silently.
Changing count >= rawSizeLimit condition to count < 0 || count >= rawSizeLimit will work.

@egv
Copy link
Author

egv commented Aug 12, 2014

0xc4 is a bin8, which, according to spec stores a byte array whose length is upto (2^8)-1 bytes. Byte is signed, meaning that all values greater than 127 will be negative even when cast to int, so SizeLimitException in case of negative length is incorrect, that;s why I have introduced my change.

@frsyuki
Copy link
Member

frsyuki commented Aug 12, 2014

Oh, I see. You're right. I miss read the change.

frsyuki added a commit that referenced this pull request Aug 12, 2014
fix for 0xc4 array length in unpacker
@frsyuki frsyuki merged commit bd988e3 into msgpack:master Aug 12, 2014
@frsyuki
Copy link
Member

frsyuki commented Aug 12, 2014

I've merged. Thank you for the pull-req!

@egv
Copy link
Author

egv commented Aug 12, 2014

You are welcome!

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.