From cd9e1be1f37984617f5082bddda6dc68e71e65d8 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 16 Aug 2024 11:16:25 +0200 Subject: [PATCH] lib/libvfio-user: Fix calloc-transposed-args reported by gcc >= 14 Fixes issue #801. Signed-off-by: Michal Berger --- lib/libvfio-user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libvfio-user.c b/lib/libvfio-user.c index 62efd308..1ff8aa09 100644 --- a/lib/libvfio-user.c +++ b/lib/libvfio-user.c @@ -624,8 +624,7 @@ handle_device_get_region_io_fds(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) msg->out.nr_fds = 0; if (max_sent_sub_regions > 0 && req->argsz >= reply->argsz) { - msg->out.fds = calloc(sizeof(int), - max_sent_sub_regions + nr_shadow_reg); + msg->out.fds = calloc(max_sent_sub_regions + nr_shadow_reg, sizeof(int)); if (msg->out.fds == NULL) { return -1; }