From 2278d9d296aa7ec37f0c648df1461e4ec77e219a Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 5 Mar 2026 21:22:08 +0800 Subject: *: Fix wsl_v5 again --- internal/compress/zlib/reader.go | 1 + internal/compress/zlib/reader_reset.go | 1 + internal/compress/zlib/writer_test.go | 4 ++++ 3 files changed, 6 insertions(+) (limited to 'internal') 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 { -- cgit v1.3.1-10-gc9f91