diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-01-09 11:54:36 +0000 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-01-09 11:54:36 +0000 |
commit | 14f1317740a355a70037e053d8d57a92b807617b (patch) | |
tree | 62e61472b577db4a8909b75472c3244a7f610761 | |
parent | e5f552c0fb274c1a02fce51267c563a06c55d334 (diff) |
Return from update_username() if myldap_get_values() returns invalid value
If myldap_get_values() failed for the attmap_passwd_uid, nss-pam-ldapd
would dereference a NULL pointer.
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1589 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nslcd/pam.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nslcd/pam.c b/nslcd/pam.c index 34ba4ed..acaf0d7 100644 --- a/nslcd/pam.c +++ b/nslcd/pam.c @@ -118,8 +118,11 @@ static void update_username(MYLDAP_ENTRY *entry,char *username,size_t username_l /* get the username from the uid attribute */ values=myldap_get_values(entry,attmap_passwd_uid); if ((values==NULL)||(values[0]==NULL)) + { log_log(LOG_WARNING,"%s: %s: missing", myldap_get_dn(entry),attmap_passwd_uid); + return; + } value=values[0]; } /* check the username */ |