Skip to content

Test case illustrating a bug with zstd decompression in klauspost/compress

License

Notifications You must be signed in to change notification settings

jnoxon/zstd-zero-length-read-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

klauspost/compress zero-length read bug example

This is a minimal example of a bug in the klauspost/compress library. When decompressing from a reader that returns zero-length reads, the decompressor may return an "unexpected EOF" error.

To reproduce, run go test -v in this directory. The test will fail with an "unexpected EOF" error.

$ go test
--- FAIL: TestZeroLengthReads (0.00s)
    poc_test.go:64: unexpected EOF
FAIL
exit status 1
FAIL	poc	0.003s

To validate the fix:

$ go mod edit -replace=github.com/klauspost/compress=github.com/jnoxon/compress@readbyte-unexpected-eof
$ go mod tidy
$ go test
PASS
ok  	poc	0.003s

About

Test case illustrating a bug with zstd decompression in klauspost/compress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages