Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
fc6e8aab
Commit
fc6e8aab
authored
Jan 22, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#15546: Fix GzipFile.peek()'s handling of pathological input data.
This is a backport of changeset 8c07ff7f882f.
parent
f186911e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
Lib/gzip.py
Lib/gzip.py
+4
-2
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/gzip.py
View file @
fc6e8aab
...
...
@@ -367,8 +367,10 @@ class GzipFile(io.BufferedIOBase):
if
self
.
fileobj
is
None
:
return
b''
try
:
# 1024 is the same buffering heuristic used in read()
self
.
_read
(
max
(
n
,
1024
))
# Ensure that we don't return b"" if we haven't reached EOF.
while
self
.
extrasize
==
0
:
# 1024 is the same buffering heuristic used in read()
self
.
_read
(
max
(
n
,
1024
))
except
EOFError
:
pass
offset
=
self
.
offset
-
self
.
extrastart
...
...
Misc/NEWS
View file @
fc6e8aab
...
...
@@ -466,6 +466,9 @@ Library
- Issue #15424: Add a __sizeof__ implementation for array objects.
Patch by Ludwig Hähne.
- Issue #15546: Fix handling of pathological input data in the peek() method
of the GzipFile class.
- Issue #13052: Fix IDLE crashing when replace string in Search/Replace dialog
ended with '\'. Patch by Roger Serwy.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment