bugfix: Allocate after sanitizing inputs
This commit is contained in:
@@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
int cb_pam_conv(int num_msg, PAM_CONST struct pam_message **msg, struct pam_response **resp, void *appdata_ptr)
|
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)
|
if (num_msg <= 0 || num_msg > PAM_MAX_NUM_MSG)
|
||||||
return PAM_CONV_ERR;
|
return PAM_CONV_ERR;
|
||||||
|
|
||||||
|
*resp = calloc(num_msg, sizeof **resp);
|
||||||
if (!*resp)
|
if (!*resp)
|
||||||
return PAM_BUF_ERR;
|
return PAM_BUF_ERR;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user