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

decode: reject strings with negative length #15

Merged
merged 1 commit into from
Aug 18, 2015

Conversation

pmezard
Copy link
Contributor

@pmezard pmezard commented Aug 16, 2015

Found running go-fuzz.

@zeebo
Copy link
Owner

zeebo commented Aug 17, 2015

Nice! Would you mind adding yourself to AUTHORS? Also do you agree to license this contribution under the terms in the LICENSE file?

@@ -79,6 +79,7 @@ func TestDecode(t *testing.T) {
{`di5ei2ee`, new(interface{}), nil, true},
{`d3:fooe`, new(interface{}), nil, true},
{`l3:foo3:bar`, new(interface{}), nil, true},
{`d3:000d3:000ld-6:`, new(interface{}), nil, true},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also i believe d-1: is a shorter test case that exhibits the same bug. this only affects strings as keys in a dictionary because top level strings get dispatched by the presence of a number, and - doesn't work.

@pmezard
Copy link
Contributor Author

pmezard commented Aug 18, 2015

PTAL

zeebo added a commit that referenced this pull request Aug 18, 2015
decode: reject strings with negative length
@zeebo zeebo merged commit a0e3ea0 into zeebo:master Aug 18, 2015
@zeebo
Copy link
Owner

zeebo commented Aug 18, 2015

Thanks!

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