From 7dfcd25b95309438c6dc4e8af76f6adac2414cc0 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 27 Sep 2016 20:14:26 +0300 Subject: Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress(). Original patch by John Leitch. --- Modules/_lzmamodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Modules/_lzmamodule.c') 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; -- cgit v1.2.1