]> granicus.if.org Git - gc/commitdiff
Fix potential multiplication overflow in check_heap_stats (test)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 12 Feb 2016 18:36:08 +0000 (21:36 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 16 Mar 2016 20:48:33 +0000 (23:48 +0300)
* 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

index 58e24248710a9faeb527e88288bb28e0a1216f23..b1daee842d5aea7f29b7b56d003bfe25f3077041 100644 (file)
@@ -1381,7 +1381,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