1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2025-02-20 21:54:16 +01:00

Merge pull request #88 from shankerwangmiao/bug-fix-for-null-conv

add check for NULL conv
This commit is contained in:
Klas Lindfors 2016-02-16 13:55:08 +01:00
commit 27d6a286d7

View File

@ -407,11 +407,15 @@ display_error(pam_handle_t *pamh, const char *message) {
return retval;
}
if(!conv || !conv->conv){
D(("conv() function invalid"));
return PAM_CONV_ERR;
}
pmsg[0] = &msg[0];
msg[0].msg = (char *) message; /* on some systems, pam_message.msg isn't const */
msg[0].msg_style = PAM_ERROR_MSG;
retval = conv->conv(1, pmsg, &resp, conv->appdata_ptr);
if (retval != PAM_SUCCESS) {
D(("conv returned error: %s", pam_strerror (pamh, retval)));
return retval;