From 3a073c463dbade2171a1a6ec1558bd81c0ff27f9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 28 Sep 2017 12:20:02 -0400 Subject: Improve unit test coverage for compression code. These tests try uncompressing garbage, verify that we won't make compression bombs, and verify that we won't uncompress compression bombs. --- src/common/compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/compress.c') diff --git a/src/common/compress.c b/src/common/compress.c index 520148f83d..c13a3b0aed 100644 --- a/src/common/compress.c +++ b/src/common/compress.c @@ -51,8 +51,8 @@ static atomic_counter_t total_compress_allocation; /** Return true if uncompressing an input of size in_size to an input of * size at least size_out looks like a compression bomb. */ -int -tor_compress_is_compression_bomb(size_t size_in, size_t size_out) +MOCK_IMPL(int, +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; -- cgit v1.2.3-54-g00ecf