File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ impl<R: Read> Read for SafeDecompressor<R> {
9090 // there was more data
9191 self . inner . set_limit ( 1 ) ;
9292 let mut buf = [ 0 ; 1 ] ;
93- if let Ok ( 1 ) = self . read ( & mut buf) {
93+ if let Ok ( 1 ) = self . inner . read ( & mut buf) {
9494 return Err ( std:: io:: Error :: new (
9595 std:: io:: ErrorKind :: InvalidData ,
9696 DecompressionError :: SizeLimitExceeded ,
@@ -127,6 +127,7 @@ mod tests {
127127 fn implode_bomb_size ( ) {
128128 let config = DecompressionConfig {
129129 max_decompressed_size : 1000 * 1024 , // slightly less than 1MB
130+ max_compression_ratio : f64:: MAX ,
130131 ..Default :: default ( )
131132 } ;
132133 let mut safe_reader = SafeDecompressor :: new (
@@ -175,6 +176,7 @@ mod tests {
175176 fn zlib_bomb_size ( ) {
176177 let config = DecompressionConfig {
177178 max_decompressed_size : 1000 * 1024 , // slightly less than 1MB
179+ max_compression_ratio : f64:: MAX ,
178180 ..Default :: default ( )
179181 } ;
180182 let data = create_zlib_bomb ( ) ;
You can’t perform that action at this time.
0 commit comments