diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-09-08 15:09:38 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-09-08 15:09:38 +0200 |
commit | cb39645e9a9bb352c1c9cb8f82f01c541a9328f4 (patch) | |
tree | 3aa20f19514b38004a9fa245105d5fa5f3d04337 | |
parent | bd4b7360924a52cf7e79f34d90454d8f238700f1 (diff) |
fix possible NULL pointer dereference (r1591 from 0.8, r1730 from 0.7)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-0.7.15+squeeze@1752 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nslcd/netgroup.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nslcd/netgroup.c b/nslcd/netgroup.c index 298b1ab..ee912a3 100644 --- a/nslcd/netgroup.c +++ b/nslcd/netgroup.c @@ -209,6 +209,12 @@ static int write_netgroup(TFILE *fp,MYLDAP_ENTRY *entry, const char *reqname) const char **members; /* get the netgroup name */ names=myldap_get_values(entry,attmap_netgroup_cn); + if ((names==NULL)||(names[0]==NULL)) + { + log_log(LOG_WARNING,"%s: %s: missing", + myldap_get_dn(entry),attmap_netgroup_cn); + return 0; + } for (i=0;(names[i]!=NULL)&&(strcmp(reqname,names[i])!=0);i++) /* nothing here */ ; if (names[i]==NULL) |