Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/netgroup.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-01-09 13:07:29 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-01-09 13:07:29 +0100
commit6e4d6b88bfcf6407cd8f8bde61c4ddf5e322554f (patch)
tree7d8cdd81d0da8ed5de3d66de51bf03391fa2b1ad /nslcd/netgroup.c
parentc471072df0bb2f438cae41c146da7a75c0d7edb2 (diff)
Check NULL return in write_netgroup()
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1591 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/netgroup.c')
-rw-r--r--nslcd/netgroup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/nslcd/netgroup.c b/nslcd/netgroup.c
index d8873f9..f6ac331 100644
--- a/nslcd/netgroup.c
+++ b/nslcd/netgroup.c
@@ -214,6 +214,13 @@ 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)