diff options
| author | Arthur de Jong <arthur@arthurdejong.org> | 2008-04-19 06:07:21 +0000 |
|---|---|---|
| committer | Arthur de Jong <arthur@arthurdejong.org> | 2008-04-19 06:07:21 +0000 |
| commit | 3e9cb8078fb117d5b5a6342d523c3d4662aef20a (patch) | |
| tree | 9e527edaf64fd99c8f71d67539e075a9b681fa3f | |
| parent | 5aeea2a92809c207c8133dc6fd69a5196b32dfbf (diff) | |
add test for emtpy DN
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@678 ef36b2f9-881f-0410-afb5-c4e39611909c
| -rw-r--r-- | nslcd/passwd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nslcd/passwd.c b/nslcd/passwd.c index 7113e64..4e06396 100644 --- a/nslcd/passwd.c +++ b/nslcd/passwd.c @@ -125,6 +125,9 @@ char *dn2uid(MYLDAP_SESSION *session,const char *dn,char *buf,size_t buflen) static const char *attrs[2]; int rc; const char **values; + /* check for empty string */ + if ((dn==NULL)||(*dn=='\0')) + return NULL; /* set up attributes */ attrs[0]=attmap_passwd_uid; attrs[1]=NULL; |
