File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,12 @@ impl InflateBackend for Inflate {
226226 self . inner . total_in += ( raw. next_in as usize - input. as_ptr ( ) as usize ) as u64 ;
227227 self . inner . total_out += ( raw. next_out as usize - output. as_ptr ( ) as usize ) as u64 ;
228228
229+ // reset these pointers so we don't accidentally read them later
230+ raw. next_in = ptr:: null_mut ( ) ;
231+ raw. avail_in = 0 ;
232+ raw. next_out = ptr:: null_mut ( ) ;
233+ raw. avail_out = 0 ;
234+
229235 match rc {
230236 MZ_DATA_ERROR | MZ_STREAM_ERROR => mem:: decompress_failed ( self . inner . msg ( ) ) ,
231237 MZ_OK => Ok ( Status :: Ok ) ,
@@ -314,6 +320,12 @@ impl DeflateBackend for Deflate {
314320 self . inner . total_in += ( raw. next_in as usize - input. as_ptr ( ) as usize ) as u64 ;
315321 self . inner . total_out += ( raw. next_out as usize - output. as_ptr ( ) as usize ) as u64 ;
316322
323+ // reset these pointers so we don't accidentally read them later
324+ raw. next_in = ptr:: null_mut ( ) ;
325+ raw. avail_in = 0 ;
326+ raw. next_out = ptr:: null_mut ( ) ;
327+ raw. avail_out = 0 ;
328+
317329 match rc {
318330 MZ_OK => Ok ( Status :: Ok ) ,
319331 MZ_BUF_ERROR => Ok ( Status :: BufError ) ,
You can’t perform that action at this time.
0 commit comments