Skip to content

Commit

Permalink
Merge pull request #85 from iawia002/fix-tar-read
Browse files Browse the repository at this point in the history
parser: fix the problem that tar content is not completely read
  • Loading branch information
iawia002 authored Mar 4, 2024
2 parents 89a3e5a + 9638e2a commit 52bde58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/parser/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 52bde58

Please sign in to comment.