diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/compress/zlib/reader.go | 1 | ||||
| -rw-r--r-- | internal/compress/zlib/reader_reset.go | 1 | ||||
| -rw-r--r-- | internal/compress/zlib/writer_test.go | 4 |
3 files changed, 6 insertions, 0 deletions
diff --git a/internal/compress/zlib/reader.go b/internal/compress/zlib/reader.go index f298a07f..3cf0066e 100644 --- a/internal/compress/zlib/reader.go +++ b/internal/compress/zlib/reader.go @@ -132,6 +132,7 @@ func (z *Reader) Read(p []byte) (int, error) { // Finished file; check checksum. readN, err := io.ReadFull(z.r, z.scratch[0:4]) + readNUint64, convErr := intconv.IntToUint64(readN) if convErr != nil { z.err = convErr diff --git a/internal/compress/zlib/reader_reset.go b/internal/compress/zlib/reader_reset.go index 3e78ab5d..fbcaccac 100644 --- a/internal/compress/zlib/reader_reset.go +++ b/internal/compress/zlib/reader_reset.go @@ -30,6 +30,7 @@ func (z *Reader) reset(r io.Reader, dict []byte) error { // Read the header (RFC 1950 section 2.2.). readN, err := io.ReadFull(z.r, z.scratch[0:2]) + readNUint64, convErr := intconv.IntToUint64(readN) if convErr != nil { z.err = convErr diff --git a/internal/compress/zlib/writer_test.go b/internal/compress/zlib/writer_test.go index e7d73c21..b2bbd6be 100644 --- a/internal/compress/zlib/writer_test.go +++ b/internal/compress/zlib/writer_test.go @@ -32,6 +32,7 @@ func testFileLevelDict(t *testing.T, fn string, level int, d string) { return } + defer func() { err := golden.Close() if err != nil { @@ -58,6 +59,7 @@ func testLevelDict(t *testing.T, fn string, b0 []byte, level int, d string) { // Push data through a pipe that compresses at the write end, and decompresses at the read end. piper, pipew := io.Pipe() + defer func() { err := piper.Close() if err != nil { @@ -79,6 +81,7 @@ func testLevelDict(t *testing.T, fn string, b0 []byte, level int, d string) { return } + defer func() { err := zlibw.Close() if err != nil { @@ -100,6 +103,7 @@ func testLevelDict(t *testing.T, fn string, b0 []byte, level int, d string) { return } + defer func() { err := zlibr.Close() if err != nil { |
