summaryrefslogtreecommitdiff
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-09 14:50:20 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-09 14:50:20 +0200
commit5ce3f10aeea711bb912e948fa5d9f63736df1327 (patch)
tree977da819c4d6e15bb355334b15b88b67d8f52c90 /Lib/zipfile.py
parent78ee3289e991882d803be4cb0dd6b4005f82cbb1 (diff)
downloadcpython-git-5ce3f10aeea711bb912e948fa5d9f63736df1327.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.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 92c98abe1e..a1b34147f8 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -860,6 +860,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))