diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-27 17:14:26 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-27 17:14:26 (GMT) |
commit | c0b7037d4fc0f85af858cfa56df4dca25fb8896f (patch) | |
tree | 4e003642f99456c981bc0735d91dc52d3f70e90f /Modules/_lzmamodule.c | |
parent | f18a5daadd6dc9d43a673a6f363d0116bee20210 (diff) | |
download | cpython-c0b7037d4fc0f85af858cfa56df4dca25fb8896f.zip cpython-c0b7037d4fc0f85af858cfa56df4dca25fb8896f.tar.gz cpython-c0b7037d4fc0f85af858cfa56df4dca25fb8896f.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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c index bc01ffe..74c301d 100644 --- a/Modules/_lzmamodule.c +++ b/Modules/_lzmamodule.c @@ -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; |