mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
Issue #20078: Reading malformed zipfiles no longer hangs with 100% CPU
consumption.
This commit is contained in:
commit
69fdbf9cb0
3 changed files with 36 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue