Merge pull request #25 from yunzheng/main

Don't use zipfile.Path to remain compatible with Python 3.6
This commit is contained in:
yunzheng
2021-12-17 08:48:12 +01:00
committed by GitHub

View File

@@ -322,7 +322,10 @@ def main():
lookup_path = str(
zpath.parent.parent / "lookup/JndiLookup.class"
)
has_lookup = zipfile.Path(zfile, lookup_path).exists()
try:
has_lookup = zfile.open(lookup_path)
except KeyError:
has_lookup = False
check_vulnerable(zf, parents + [zpath], stats, has_lookup)
except IOError as e:
log.debug(f"{p}: {e}")