-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Unmarshaling errors for packed fields #76
Comments
Odd input 1. Field4 has tag 4, wire 2, which means its header should be 0x24. I don't see that byte anywhere. The first byte, 0x6a, is 13<<3|2, which is for Field13, followed by 0x16 (len=22), followed by 22 bytes. That should code into Field13, and nothing else. Are you sure proto.Unmarshal is saying bad wiretype for Field4? |
Yes my generated code and protoc decode-raw decodes those bytes into
, but the reflected/unsafe code returns this error
|
I have those tests here and ready to go
|
The first input,
is valid. The Go code is incorrectly returning |
This doesn't occur in practice, but was discovered by gofuzz (reported in #76).
0c959e8 deals with |
The second input ( |
The third input ( I think everything is fixed here. Thanks for the report! |
My pleasure :) You should be able to reproduce it using some quick editing of my fuzztests Fuzz function. Or you can wait a few months for when I get the time to do the inefficient varint detecting to properly catch those bugs. |
fuzz tests for packed fields are looking good 👍 |
protoc --decode-raw does not return any error, but golang/protobuf does.
Given the following message
Given the following inputs
returns bad wiretype for Field4
returns unexpected eof
returns cant skip wiretype
These were found using go-fuzz @dvyukov
Using this fuzz test
https://github.com/gogo/fuzztests/tree/e62df375312286dd3e1e65abffef3a3407dcd6b0
The text was updated successfully, but these errors were encountered: