From: Ivan Maidanski Date: Fri, 12 Feb 2016 18:36:08 +0000 (+0300) Subject: Fix potential multiplication overflow in check_heap_stats (test) X-Git-Tag: gc7_4_4~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d45ac9ed9e0e325d0b4ca8007df54f995048c0a1;p=gc Fix potential multiplication overflow in check_heap_stats (test) * tests/test.c (check_heap_stats): Cast n_tests to size_t before multiplication by 2700000 (instead of implicit cast to size_t of the result). --- diff --git a/tests/test.c b/tests/test.c index 4c1cc7fc..c1a7da39 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1500,7 +1500,7 @@ void check_heap_stats(void) (unsigned long)GC_get_total_bytes()); GC_printf("Final heap size is %lu bytes\n", (unsigned long)GC_get_heap_size()); - if (GC_get_total_bytes() < n_tests * + if (GC_get_total_bytes() < (size_t)n_tests * # ifdef VERY_SMALL_CONFIG 2700000 # else