From 5200ff4d82bb7e6344f33d104e3de03e4325340b Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 12 Feb 2016 21:36:08 +0300 Subject: [PATCH] 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). --- tests/test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.c b/tests/test.c index a09c4ad..6ae1b05 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1554,7 +1554,7 @@ void check_heap_stats(void) (unsigned long)GC_get_memory_use()); 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 -- 2.7.4