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
7051cb36
Commit
7051cb36
authored
Sep 27, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress().
Original patch by John Leitch.
parent
bf39eb2c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
Lib/test/test_lzma.py
Lib/test/test_lzma.py
+9
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_lzmamodule.c
Modules/_lzmamodule.c
+3
-1
No files found.
Lib/test/test_lzma.py
View file @
7051cb36
...
...
@@ -246,6 +246,15 @@ class CompressorDecompressorTestCase(unittest.TestCase):
lzd
=
LZMADecompressor
(
lzma
.
FORMAT_RAW
,
filters
=
FILTERS_RAW_1
)
self
.
assertRaises
(
LZMAError
,
lzd
.
decompress
,
COMPRESSED_XZ
)
def
test_decompressor_bug_28275
(
self
):
# Test coverage for Issue 28275
lzd
=
LZMADecompressor
()
for
i
in
range
(
2
):
try
:
lzd
.
decompress
(
COMPRESSED_RAW_1
)
except
LZMAError
:
pass
# Test that LZMACompressor->LZMADecompressor preserves the input data.
def
test_roundtrip_xz
(
self
):
...
...
Misc/NEWS
View file @
7051cb36
...
...
@@ -80,6 +80,9 @@ Core and Builtins
Library
-------
- Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress().
Original patch by John Leitch.
- Issue #27897: Fixed possible crash in sqlite3.Connection.create_collation()
if pass invalid string-like object as a name. Patch by Xiang Zhang.
...
...
Modules/_lzmamodule.c
View file @
7051cb36
...
...
@@ -1005,8 +1005,10 @@ decompress(Decompressor *d, uint8_t *data, size_t len, Py_ssize_t max_length)
}
result
=
decompress_buf
(
d
,
max_length
);
if
(
result
==
NULL
)
if
(
result
==
NULL
)
{
lzs
->
next_in
=
NULL
;
return
NULL
;
}
if
(
d
->
eof
)
{
d
->
needs_input
=
0
;
...
...
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