commit 7540feba4b4de98267238d144d98d844d0e728e7
parent dd92906c0ff9e753b4586c50deae420d128a4aef
Author: David Goulet <dgoulet@torproject.org>
Date: Wed, 10 Sep 2025 13:11:15 -0400
Merge branch 'maint-0.4.8'
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/lib/compress/compress.c b/src/lib/compress/compress.c
@@ -66,11 +66,13 @@ tor_compress_is_compression_bomb,(size_t size_in, size_t size_out))
if (size_in == 0 || size_out < CHECK_FOR_COMPRESSION_BOMB_AFTER)
return 0;
- if (size_out / size_in > MAX_UNCOMPRESSION_FACTOR) {
+ double compression_factor = (double)size_out / size_in;
+ if (compression_factor > MAX_UNCOMPRESSION_FACTOR) {
log_warn(LD_GENERAL,
"Detected possible compression bomb with "
- "input size = %"TOR_PRIuSZ " and output size = %"TOR_PRIuSZ,
- size_in, size_out);
+ "input size = %"TOR_PRIuSZ" and output size = %"TOR_PRIuSZ" "
+ "(compression factor = %.2f)",
+ size_in, size_out, compression_factor);
return 1;
}