diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-27 20:14:26 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-27 20:14:26 +0300 |
commit | 7dfcd25b95309438c6dc4e8af76f6adac2414cc0 (patch) | |
tree | 49a7a16310d4fe3db3fdf03a22e5eaebdfcfcc15 /Modules/_lzmamodule.c | |
parent | e1cac1196c44fdbee6b02f50301ba150c7607833 (diff) | |
download | cpython-7dfcd25b95309438c6dc4e8af76f6adac2414cc0.tar.gz |
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 bc01ffe7ac..74c301d47a 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; |