We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following program crashes with a panic:
package main import "github.com/golang/snappy/snappy" func main() { data := []byte("\xff\xff\xff\xff\xff\xff\xff\xff\xec0") n, err := snappy.DecodedLen(data) if err != nil || n > 1e6 { return } dec, err := snappy.Decode(nil, data) if err != nil { if dec != nil { panic("dec is not nil") } return } if len(dec) != n { println(len(dec), n) panic("bad decoded len") } n = snappy.MaxEncodedLen(len(dec)) enc, err := snappy.Encode(nil, dec) if err != nil { panic(err) } if len(enc) > n { panic("bad encoded len") } }
panic: runtime error: index out of range goroutine 1 [running]: github.com/golang/snappy/snappy.Decode(0x0, 0x0, 0x0, 0xc208041f00, 0xa, 0x20, 0x0, 0x0, 0x0, 0x0, ...) src/github.com/golang/snappy/snappy/decode.go:54 +0xaca main.main() snappy.go:11 +0xf6
on commit 156a073
The text was updated successfully, but these errors were encountered:
Also, on this input DecodedLen returns a negative size. It must not return negative size, it must return an error instead.
Sorry, something went wrong.
Also, decodedLen does not check error condition returned by binary.Uvarint.
fix Uvarint overflow. (see golang#11)
432dca5
f4b10fa
No branches or pull requests
The following program crashes with a panic:
on commit 156a073
The text was updated successfully, but these errors were encountered: