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
#343) (#344)

Signed-off-by: João Reigota <joao.reigota@checkmarx.com>
  • Loading branch information
joaoReigota1 authored Feb 1, 2022
1 parent b1336de commit 4553965
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 4553965

Please sign in to comment.