diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-09-28 12:20:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-28 12:20:02 -0400 |
commit | 3a073c463dbade2171a1a6ec1558bd81c0ff27f9 (patch) | |
tree | 28d329ccf721ef02e2e7973337b94e84fc88d3f2 /src/common/compress.c | |
parent | 14614a592e43e2a6fcddb79c3f4ff5c8df60f380 (diff) | |
download | tor-3a073c463dbade2171a1a6ec1558bd81c0ff27f9.tar.gz tor-3a073c463dbade2171a1a6ec1558bd81c0ff27f9.zip |
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.
Diffstat (limited to 'src/common/compress.c')
-rw-r--r-- | src/common/compress.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 <b>in_size</b> to an input of * size at least <b>size_out</b> 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; |