From 9638e2ad31f06349469986bf64cf720e43557883 Mon Sep 17 00:00:00 2001 From: Xinzhao Xu Date: Mon, 4 Mar 2024 08:57:08 +0800 Subject: [PATCH] parser: fix the problem that tar content is not completely read --- pkg/parser/validate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parser/validate.go b/pkg/parser/validate.go index d41cbe6..fbfe84e 100644 --- a/pkg/parser/validate.go +++ b/pkg/parser/validate.go @@ -39,7 +39,7 @@ func ValidateExtension(name string, zipFile []byte) error { continue } buffer := make([]byte, h.Size) - if _, err = tr.Read(buffer); err != nil && err != io.EOF { + if _, err = io.ReadFull(tr, buffer); err != nil && err != io.EOF { return fmt.Errorf("read tar file failed: %s", err.Error()) } metadata := new(extension.Metadata)