Commit 62dcbdf1 by devttys0

Fixed bug in gzipvalid plugin WRT gzip checksums

parent 722d8754
...@@ -38,6 +38,10 @@ class GzipValidPlugin(binwalk.core.plugin.Plugin): ...@@ -38,6 +38,10 @@ class GzipValidPlugin(binwalk.core.plugin.Plugin):
try: try:
zlib.decompress(binwalk.core.compat.str2bytes(data)) zlib.decompress(binwalk.core.compat.str2bytes(data))
except zlib.error as e: except zlib.error as e:
if not str(e).startswith("Error -5"): error = str(e)
# Truncated input data results in error -5.
# gzip uses different checksums than zlib, which results in error -3.
if not error.startswith("Error -5") and not error.startswith("Error -3"):
result.valid = False result.valid = False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment