Commit 9c7e817c authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

Don't crash on invalid zipfiles, even if we encounter 'badness' halfway...

Don't crash on invalid zipfiles, even if we encounter 'badness' halfway through the file. (Re: Debian:#1068705)
parent 945fd9fa
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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