From 22a0514369a0a377f8c5d40675fea68adaf1d333 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 11 Jul 2019 12:33:51 -0700 Subject: chk_calloc: use unsigned arithmetic. * lib.c (chk_calloc): Use unsigned arithmetic to figure out the total, which is only used for incrementing the malloc_bytes counter. The unsigned arithmetic is performed in the same type as that counter. --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 1e7d8885..db59cd60 100644 --- a/lib.c +++ b/lib.c @@ -2839,7 +2839,7 @@ mem_t *chk_malloc_gc_more(size_t size) mem_t *chk_calloc(size_t n, size_t size) { mem_t *ptr = convert(mem_t *, calloc(n, size)); - cnum total = convert(cnum, size) * convert(cnum, n); + alloc_bytes_t total = convert(alloc_bytes_t, size) * n; assert (!async_sig_enabled); -- cgit v1.2.3