Skip to content

Commit

Permalink
lib/libvfio-user: Fix calloc-transposed-args reported by gcc >= 14 (#802
Browse files Browse the repository at this point in the history
)

Fixes issue #801.

Signed-off-by: Michal Berger <michal.berger@intel.com>
(cherry picked from commit a5fca05)
  • Loading branch information
mikeBashStuff authored and jlevon committed Aug 16, 2024
1 parent cf96a63 commit 5b82b96
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 @@ -656,8 +656,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 5b82b96

Please sign in to comment.