From b9f347a574851d01f058663d7b65a108b9f980bc Mon Sep 17 00:00:00 2001 From: "Arvid E. Picciani" Date: Wed, 13 Jul 2022 11:22:15 +0200 Subject: [PATCH] fixes #11142 missing array length check on release Signed-off-by: Arvid E. Picciani --- pkg/storage/driver/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/driver/util.go b/pkg/storage/driver/util.go index e5b846163..b5908e508 100644 --- a/pkg/storage/driver/util.go +++ b/pkg/storage/driver/util.go @@ -63,7 +63,7 @@ func decodeRelease(data string) (*rspb.Release, error) { // For backwards compatibility with releases that were stored before // compression was introduced we skip decompression if the // gzip magic header is not found - if bytes.Equal(b[0:3], magicGzip) { + if len(b) > 3 && bytes.Equal(b[0:3], magicGzip) { r, err := gzip.NewReader(bytes.NewReader(b)) if err != nil { return nil, err