summaryrefslogtreecommitdiffstats
path: root/Modules/_bz2module.c
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-10-01 02:45:17 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-10-01 02:45:17 (GMT)
commit38317d3318e05832a864d413aa744a48a8975dce (patch)
tree8757c1d2116ed1d20aa28b02e0b11f05e9bc3412 /Modules/_bz2module.c
parent34b9d14be642be80e9ac10c59004570a7efa5804 (diff)
downloadcpython-38317d3318e05832a864d413aa744a48a8975dce.zip
cpython-38317d3318e05832a864d413aa744a48a8975dce.tar.gz
cpython-38317d3318e05832a864d413aa744a48a8975dce.tar.bz2
Issue #28275: Clean up to avoid use-after-free after bzip decompress failure
Diffstat (limited to 'Modules/_bz2module.c')
-rw-r--r--Modules/_bz2module.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c
index e3e0eb1..67e1b65 100644
--- a/Modules/_bz2module.c
+++ b/Modules/_bz2module.c
@@ -534,8 +534,10 @@ decompress(BZ2Decompressor *d, char *data, size_t len, Py_ssize_t max_length)
}
result = decompress_buf(d, max_length);
- if(result == NULL)
+ if(result == NULL) {
+ bzs->next_in = NULL;
return NULL;
+ }
if (d->eof) {
d->needs_input = 0;