Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBefore unserializing a Redis value with igbinary, check if it actually contains the correct header #761
Conversation
…y contains the correct header
|
Thanks for the merge request. Is that header an 'always and forever' type thing, or could it pose problems depending on the version of igbinary? Cheers |
|
As I couldn't find any documentation on the igbinary protocol, I based myself on the igbinary source. I'm not sure if this is an 'always and forever' thing, but so far there seem to have been only 2 versions of the igbinary protocol and they start with a 0x1 and 0x2 header respectively. An alternative way would be igbinary exposing an extra function (eg |
That would seem almost too logical I don't have a problem inlining the validation like this but was just wondering if we would run into versioning problems for ancient versions of igbinary. I'll pull it down and give it a test and then get it merged for you. Thanks again! |
|
I changed the val_len check to not include the NULL byte, as in the first commit it wasn't being written. |
|
I fetched your repo and have merged this into the Then I have to do all of it again for |
mcuelenaere commentedMar 15, 2016
The bug can be reproduced with this script:
and will result in this output: