1
0
mirror of synced 2024-11-22 01:04:23 +01:00

Improve archive-based parser's robustness against corrupted embedded files

This commit is contained in:
jvoisin 2018-10-25 11:56:12 +02:00
parent 513d897ea0
commit 283e5e5787

View File

@ -138,7 +138,13 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
abort = True
continue
if tmp_parser:
tmp_parser.remove_all()
if tmp_parser.remove_all() is False:
logging.warning("In file %s, something went wrong \
with the cleaning of %s \
(format: %s)",
self.filename, item.filename, mtype)
abort = True
continue
os.rename(tmp_parser.output_filename, full_path)
zinfo = zipfile.ZipInfo(item.filename) # type: ignore