Skip to content

Conversation

@daniellockyer
Copy link
Contributor

@daniellockyer daniellockyer commented Mar 23, 2017

A crashing input looks like \x93NUMPY\x01\x00\xf8\xff.

According to the spec, the bytes following \x01\x00 should be an unsigned short int.

The next 2 bytes form a little-endian unsigned short int: the length of the header data HEADER_LEN.

nom was told to use a signed short int which would panic further code when given the wrong size.

Fixes #1 and found by cargo-fuzz. It was found within ~30 executions but following the patch, I'm currently at 2 million with no crashes.

According to the spec, the bytes following `\x01\x00` should be an
unsigned short int. `nom` was told to use a signed int which would
panic when given the wrong size.
@potocpav potocpav merged commit 0980ff3 into potocpav:master Mar 24, 2017
@daniellockyer daniellockyer deleted the fix-panic branch March 24, 2017 13:22
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