From 8003ee5660aae5e28b57543cae9bf786efec0bcc Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sun, 13 Mar 2022 11:46:24 +0100 Subject: [PATCH] get_global_int_statistics(): Cast to size_t before operation is done Use a cast to ensure that the multiplication is done using size_t. Signed-off-by: Sebastien GODARD --- sa_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sa_common.c b/sa_common.c index 7cd1c16..ef631f3 100644 --- a/sa_common.c +++ b/sa_common.c @@ -3325,7 +3325,7 @@ void get_global_int_statistics(struct activity *a, int prev, int curr, if (stc_cpu_sum->irq_nr == 0) { /* Assume current CPU is offline */ masked_cpu_bitmap[i >> 3] |= 1 << (i & 0x07); - memcpy(stc_cpu_sum, stp_cpu_sum, a->msize * a->nr2); + memcpy(stc_cpu_sum, stp_cpu_sum, (size_t) a->msize * a->nr2); } } -- 2.40.0