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

compress/bzip2: decoder panics on malformed input #5747

Closed
gopherbot opened this issue Jun 21, 2013 · 4 comments
Closed

compress/bzip2: decoder panics on malformed input #5747

gopherbot opened this issue Jun 21, 2013 · 4 comments
Milestone

Comments

@gopherbot
Copy link

by foobaz:

This program reproduces the issue:
http://play.golang.org/p/WI-rKRU4Ld

What is the expected output?
I expect it to not panic. The function compress/bzip2.(*reader).Read() should return
zero bytes if it cannot read any further due to bad input.

What do you see instead?
"panic: runtime error: index out of range" in
compress/bzip2.(*reader).readBlock()

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux (Debian Wheezy 64-bit), and whatever play.golang.org uses.

Which version are you using?  (run 'go version')
1.1
@davecheney
Copy link
Contributor

Comment 1:

Nice repro, thanks for raising this issue.

Labels changed: added priority-soon, go1.2, removed priority-triage.

Status changed to Accepted.

@agl
Copy link
Contributor

agl commented Jun 21, 2013

Comment 4:

Owner changed to @agl.

@agl
Copy link
Contributor

agl commented Jun 21, 2013

Comment 5:

https://golang.org/cl/10401050

@bradfitz
Copy link
Contributor

Comment 6:

*** Submitted as https://code.google.com/p/go/source/detail?r=13e16bc02f6d ***
compress/bzip2: don't panic on invalid input.
Fixes 5747.
R=golang-dev, r, bradfitz
CC=golang-dev

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants