Changeset 57 in openpam


Ignore:
Timestamp:
Feb 13, 2002, 2:17:31 AM (17 years ago)
Author:
Dag-Erling Smørgrav
Message:

pam_get_item(3) expects a const void , not a const void *. Also
check that the pam_conv structure it returns is not NULL.

Sponsored by: DARPA, NAI Labs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pam_vprompt.c

    r39 r57  
    5959        const struct pam_message *msgp;
    6060        struct pam_response *rsp;
    61         struct pam_conv conv;
     61        struct pam_conv *conv;
    6262        int r;
    6363
    64         if ((r = pam_get_item(pamh, PAM_CONV, (void *)&conv)) != PAM_SUCCESS)
     64        r = pam_get_item(pamh, PAM_CONV, (const void **)&conv);
     65        if (r != PAM_SUCCESS)
    6566                return (r);
     67        if (conv == NULL) {
     68                openpam_log(PAM_LOG_ERROR, "no conversation function");
     69                return (PAM_SYSTEM_ERR);
     70        }
    6671        vsnprintf(msgbuf, PAM_MAX_MSG_SIZE, fmt, ap);
    6772        msg.msg_style = style;
    6873        msg.msg = msgbuf;
    6974        msgp = &msg;
    70         r = (conv.conv)(1, &msgp, &rsp, conv.appdata_ptr);
     75        r = (conv->conv)(1, &msgp, &rsp, conv->appdata_ptr);
    7176        *resp = rsp == NULL ? NULL : rsp->resp;
    7277        free(rsp);
Note: See TracChangeset for help on using the changeset viewer.