From b324e2b31bb8291945ab754e32a7a3bc12a43987 Mon Sep 17 00:00:00 2001 From: Michael Steinert Date: Thu, 21 Sep 2023 08:12:18 -0500 Subject: bugfix: Allocate after sanitizing inputs --- transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3