Skip to content

Commit 2518ac4

Browse files
committed
Fix zlib test that was failing for theh wrong reason after compression ratio default change.
1 parent 7e42a57 commit 2518ac4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

broodrep/src/compression.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)