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 {
226
226
self . inner . total_in += ( raw. next_in as usize - input. as_ptr ( ) as usize ) as u64 ;
227
227
self . inner . total_out += ( raw. next_out as usize - output. as_ptr ( ) as usize ) as u64 ;
228
228
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
+
229
235
match rc {
230
236
MZ_DATA_ERROR | MZ_STREAM_ERROR => mem:: decompress_failed ( self . inner . msg ( ) ) ,
231
237
MZ_OK => Ok ( Status :: Ok ) ,
@@ -314,6 +320,12 @@ impl DeflateBackend for Deflate {
314
320
self . inner . total_in += ( raw. next_in as usize - input. as_ptr ( ) as usize ) as u64 ;
315
321
self . inner . total_out += ( raw. next_out as usize - output. as_ptr ( ) as usize ) as u64 ;
316
322
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
+
317
329
match rc {
318
330
MZ_OK => Ok ( Status :: Ok ) ,
319
331
MZ_BUF_ERROR => Ok ( Status :: BufError ) ,
You can’t perform that action at this time.
0 commit comments