From a03929dccb105029d0ec249f14f7d9d4a0bce015 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Thu, 24 Feb 2022 09:51:38 +0100 Subject: [PATCH] sar: Make sure that all the buffers are copied in copy_structures() 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 1535e3a..f4ec555 100644 --- a/sa_common.c +++ b/sa_common.c @@ -1556,7 +1556,7 @@ void copy_structures(struct activity *act[], unsigned int id_seq[], p = get_activity_position(act, id_seq[i], EXIT_IF_NOT_FOUND); memcpy(act[p]->buf[dest], act[p]->buf[src], - (size_t) act[p]->msize * (size_t) act[p]->nr[src] * (size_t) act[p]->nr2); + (size_t) act[p]->msize * (size_t) act[p]->nr_allocated * (size_t) act[p]->nr2); act[p]->nr[dest] = act[p]->nr[src]; } } -- 2.40.0