Changeset 258 in openpam for trunk


Ignore:
Timestamp:
Jun 18, 2003, 11:14:58 AM (16 years ago)
Author:
Dag-Erling Smørgrav
Message:

Checking the return value from pam_get_item(3) isn't enough, we also
have to check that the item isn't NULL.

Submitted by: marcus

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/pam_get_user.c

    r245 r258  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/pam_get_user.c#17 $
     34 * $P4: //depot/projects/openpam/lib/pam_get_user.c#18 $
    3535 */
    3636
     
    4444#include "openpam_impl.h"
    4545
    46 const char user_prompt[] = "Login:";
     46static const char user_prompt[] = "Login:";
    4747
    4848/*
     
    6565                RETURNC(PAM_SYSTEM_ERR);
    6666        r = pam_get_item(pamh, PAM_USER, (const void **)user);
    67         if (r == PAM_SUCCESS)
     67        if (r == PAM_SUCCESS && *user != NULL)
    6868                RETURNC(PAM_SUCCESS);
    6969        if (prompt == NULL) {
Note: See TracChangeset for help on using the changeset viewer.