Skip to content

Commit

Permalink
lib/libvfio-user: Fix calloc-transposed-args reported by gcc >= 14
Browse files Browse the repository at this point in the history
Fixes issue #801.

Signed-off-by: Michal Berger <michal.berger@intel.com>
  • Loading branch information
mikeBashStuff committed Aug 16, 2024
1 parent 2bf46f2 commit 7a1825f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/libvfio-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7a1825f

Please sign in to comment.