mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#15546: Fix {GzipFile,LZMAFile}.read1()'s handling of pathological input data.
This commit is contained in:
parent
9c92a691e1
commit
37d3ff1487
3 changed files with 33 additions and 22 deletions
|
@ -385,7 +385,10 @@ class GzipFile(io.BufferedIOBase):
|
|||
return b''
|
||||
|
||||
try:
|
||||
self._read()
|
||||
# For certain input data, a single call to _read() may not return
|
||||
# any data. In this case, retry until we get some data or reach EOF.
|
||||
while self.extrasize <= 0:
|
||||
self._read()
|
||||
except EOFError:
|
||||
pass
|
||||
if size < 0 or size > self.extrasize:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue