summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2009-12-30 15:04:55 -0500
committerJim McDonough <jmcd@samba.org>2009-12-30 15:06:07 -0500
commit3a271a89b5e6d23089f9391f0cfd42f6631c925a (patch)
treeee5ada05cc99b03d028e7142cb6bbc4c0f136688
parent1aed373b119b98bf767ab02ea14940d017ad3868 (diff)
downloadsamba-3a271a89b5e6d23089f9391f0cfd42f6631c925a.tar.gz
samba-3a271a89b5e6d23089f9391f0cfd42f6631c925a.tar.bz2
samba-3a271a89b5e6d23089f9391f0cfd42f6631c925a.zip
Prevent NULL dereference if group has no members
-rw-r--r--source3/winbindd/winbindd_rpc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index ffe488ac71..e7003766d8 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -787,16 +787,16 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
if (!NT_STATUS_IS_OK(result))
return result;
- *num_names = rids->count;
- rid_mem = rids->rids;
-
- if (!*num_names) {
+ if (!rids || !rids->count) {
names = NULL;
name_types = NULL;
sid_mem = NULL;
return NT_STATUS_OK;
}
+ *num_names = rids->count;
+ rid_mem = rids->rids;
+
/* Step #2: Convert list of rids into list of usernames. Do this
in bunches of ~1000 to avoid crashing NT4. It looks like there
is a buffer overflow or something like that lurking around