Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU

consumption.
This commit is contained in:
Serhiy Storchaka 2014-01-09 14:53:41 +02:00
commit 69fdbf9cb0
3 changed files with 36 additions and 0 deletions

View file

@ -862,6 +862,8 @@ class ZipExtFile(io.BufferedIOBase):
data = self._fileobj.read(n)
self._compress_left -= len(data)
if not data:
raise EOFError
if self._decrypter is not None:
data = bytes(map(self._decrypter, data))