[Git][reproducible-builds/diffoscope][master] Don't crash on invalid zipfiles, even if we encounter 'badness' halfway...

Chris Lamb (@lamby) gitlab at salsa.debian.org
Thu Apr 11 10:28:26 UTC 2024



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
9c7e817c by Chris Lamb at 2024-04-11T11:25:20+01:00
Don't crash on invalid zipfiles, even if we encounter 'badness' halfway through the file. (Re: Debian:#1068705)

- - - - -


1 changed file:

- diffoscope/comparators/zip.py


Changes:

=====================================
diffoscope/comparators/zip.py
=====================================
@@ -210,6 +210,8 @@ class ZipContainer(Archive):
             ) as target:
                 shutil.copyfileobj(source, target)
             return targetpath.decode(sys.getfilesystemencoding())
+        except zipfile.BadZipFile as e:
+            raise ContainerExtractionError(member_name, e)
         except RuntimeError as e:
             # Handle encrypted files see line 1292 of zipfile.py
             is_encrypted = self.archive.getinfo(member_name).flag_bits & 0x1



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/9c7e817c79f19e67e56d564b55b728a54a35423b

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/9c7e817c79f19e67e56d564b55b728a54a35423b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20240411/13f12c0d/attachment.htm>


More information about the rb-commits mailing list