summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-09-27 17:24:19 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-09-27 17:24:19 (GMT)
commitbe43f2019fd5c56cdf9ca337ed23c1ef4dc9af38 (patch)
tree6a00762f3a35466ead9346402b7db0894ffd9ad7 /Modules
parentc019158a4c7a7b79a7d2d4f1de87c8789a5ec13d (diff)
parenta12e7842a5f572afd6bde108f24931f9262f38ef (diff)
downloadcpython-be43f2019fd5c56cdf9ca337ed23c1ef4dc9af38.zip
cpython-be43f2019fd5c56cdf9ca337ed23c1ef4dc9af38.tar.gz
cpython-be43f2019fd5c56cdf9ca337ed23c1ef4dc9af38.tar.bz2
Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress().
Original patch by John Leitch.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_lzmamodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c
index 5e158fd..f5dcea1 100644
--- a/Modules/_lzmamodule.c
+++ b/Modules/_lzmamodule.c
@@ -995,8 +995,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;