From 6e4d6b88bfcf6407cd8f8bde61c4ddf5e322554f Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 9 Jan 2012 12:07:29 +0000 Subject: 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 --- nslcd/netgroup.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nslcd/netgroup.c') 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) -- cgit v1.2.3