Issue #28275: Fixed possible use adter free in LZMADecompressor.decompress().

Original patch by John Leitch.
This commit is contained in:
Serhiy Storchaka 2016-09-27 20:14:26 +03:00
parent f18a5daadd
commit c0b7037d4f
3 changed files with 15 additions and 1 deletions

View file

@ -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;