It is very unlikely that PAM would send more than this.
Co-Authored-By: netliomax25-code <netliomax25@gmail.com>
# define pam_const const
#endif
+#define PAM_MAX_MESSAGES 1024
+
typedef pam_const void *pam_item_t;
struct pam_passdb_module {
int i;
*resp_r = NULL;
+ if (num_msg > PAM_MAX_MESSAGES) {
+ e_error(authdb_event(ctx->request),
+ "PAM wanted to send %u messages, which exceeds limit %u",
+ num_msg, PAM_MAX_MESSAGES);
+ return PAM_CONV_ERR;
+ }
resp = calloc(num_msg, sizeof(struct pam_response));
if (resp == NULL)