Skip to content

Commit

Permalink
fix(gzip): empty files are invalid and should not be parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Fasano committed Feb 25, 2024
1 parent 8d9c18b commit 5f66c07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions unblob/handlers/compression/gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class MultiVolumeGzipHandler(DirectoryHandler):
PATTERN = Glob("*.gz.*")

def is_valid_gzip(self, path: Path) -> bool:
if path.stat().st_size == 0:
return False
with File.from_path(path) as f:
try:
fp = SingleMemberGzipReader(f)
Expand Down

0 comments on commit 5f66c07

Please sign in to comment.