Skip to content

Commit

Permalink
qubes-gui-runuser: fix parameters order for calloc
Browse files Browse the repository at this point in the history
GCC 14 complains:

qubes-gui-runuser.c: In function ...pam_conv_callback...:
qubes-gui-runuser.c:48:23: error: ...calloc... sizes specified with ...sizeof... in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
   48 |         calloc(sizeof(struct pam_response), num_msg);
      |                       ^~~~~~
qubes-gui-runuser.c:48:23: note: earlier argument should specify number of elements, later size of each element
cc1: all warnings being treated as errors

QubesOS/qubes-issues#8915
  • Loading branch information
marmarek committed Feb 5, 2024
1 parent 3b287d5 commit 42b6640
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gui-agent/qubes-gui-runuser.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static int pam_conv_callback(int num_msg, const struct pam_message **msg,
{
int i;
struct pam_response *resp_array =
calloc(sizeof(struct pam_response), num_msg);
calloc(num_msg, sizeof(struct pam_response));

if (resp_array == NULL)
return PAM_BUF_ERR;
Expand Down

0 comments on commit 42b6640

Please sign in to comment.