summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Steinert <[email protected]>2023-09-21 08:12:18 -0500
committerMichael Steinert <[email protected]>2023-09-21 08:24:04 -0500
commitb324e2b31bb8291945ab754e32a7a3bc12a43987 (patch)
treea913dcbbc998e41514cf1884380016cc914c6f8c
parentdf9e70a6d733f806a827e0a465ab33e7881b1e8d (diff)
bugfix: Allocate after sanitizing inputs
-rw-r--r--transaction.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/transaction.c b/transaction.c
index dcc32eb..8abed03 100644
--- a/transaction.c
+++ b/transaction.c
@@ -11,10 +11,10 @@
int cb_pam_conv(int num_msg, PAM_CONST struct pam_message **msg, struct pam_response **resp, void *appdata_ptr)
{
- *resp = calloc(num_msg, sizeof **resp);
if (num_msg <= 0 || num_msg > PAM_MAX_NUM_MSG)
return PAM_CONV_ERR;
+ *resp = calloc(num_msg, sizeof **resp);
if (!*resp)
return PAM_BUF_ERR;