Don't use zipfile.Path to remain compatible with Python 3.6

This commit is contained in:
Yun Zheng Hu
2021-12-17 08:44:24 +01:00
parent b15038b99c
commit 7a9e76a8bf

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}")