From d105557d39f7bfe87418a7878516a6254761992c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 15 Dec 2023 16:29:39 +0000 Subject: [PATCH] squashfs: close the gz compressor to make sure we read CRC errors --- filesystem/squashfs/compressor.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/filesystem/squashfs/compressor.go b/filesystem/squashfs/compressor.go index 4076a471..173edabf 100644 --- a/filesystem/squashfs/compressor.go +++ b/filesystem/squashfs/compressor.go @@ -110,6 +110,9 @@ func (c *CompressorGzip) decompress(in []byte) ([]byte, error) { if err != nil { return nil, fmt.Errorf("error decompressing: %v", err) } + if err := gz.Close(); err != nil { + return nil, err + } return p, nil }