Skip to content

Commit

Permalink
fix(decompresser_zip): fix panic when decompressing protected zip file (
Browse files Browse the repository at this point in the history
hashicorp#343)

Signed-off-by: João Reigota <[email protected]>
  • Loading branch information
joaoReigota1 committed Dec 20, 2021
1 parent 64f1c03 commit 50599d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion decompress_zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ func (d *ZipDecompressor) Decompress(dst, src string, dir bool, umask os.FileMod
// Open the file for reading
srcF, err := f.Open()
if err != nil {
srcF.Close()
if srcF != nil {
srcF.Close()
}
return err
}

Expand Down

0 comments on commit 50599d6

Please sign in to comment.