summaryrefslogtreecommitdiffstats
path: root/Modules/_lzmamodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-09-27 17:23:41 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-09-27 17:23:41 (GMT)
commita12e7842a5f572afd6bde108f24931f9262f38ef (patch)
treea7bd0d9db6ec6a3c16cff1e2ac3a343a230dadd6 /Modules/_lzmamodule.c
parent19f2327e7ee3cc307b8b59329c552583d29ffa57 (diff)
parentc0b7037d4fc0f85af858cfa56df4dca25fb8896f (diff)
downloadcpython-a12e7842a5f572afd6bde108f24931f9262f38ef.zip
cpython-a12e7842a5f572afd6bde108f24931f9262f38ef.tar.gz
cpython-a12e7842a5f572afd6bde108f24931f9262f38ef.tar.bz2
Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress().
Original patch by John Leitch.
Diffstat (limited to 'Modules/_lzmamodule.c')
-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;