diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-09 14:53:41 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-09 14:53:41 +0200 |
commit | 69fdbf9cb02b09fdebe3ce13ec3be56d69657a3c (patch) | |
tree | caeb7277649d381846ee1a69f1e30298e8c50eee /Lib/zipfile.py | |
parent | 0ae7ae1fc9fe8891ad3daf26a2dec3967600a7e7 (diff) | |
parent | 5ce3f10aeea711bb912e948fa5d9f63736df1327 (diff) | |
download | cpython-git-69fdbf9cb02b09fdebe3ce13ec3be56d69657a3c.tar.gz |
Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU
consumption.
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r-- | Lib/zipfile.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 173d99080c..12c1754d71 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -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)) |