diff options
author | Jim McDonough <jmcd@samba.org> | 2009-12-30 18:19:46 -0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2010-01-13 14:01:05 +0100 |
commit | 26bb48ec4d14addbf915d80bbec5656dc0fff155 (patch) | |
tree | 7b9cc15a04c146c3c18b41c9da853319ef47e0fd /source | |
parent | ff8ab11dacb7e4f4c2cba76af46de88f24336309 (diff) | |
download | samba-26bb48ec4d14addbf915d80bbec5656dc0fff155.tar.gz samba-26bb48ec4d14addbf915d80bbec5656dc0fff155.tar.xz samba-26bb48ec4d14addbf915d80bbec5656dc0fff155.zip |
Prevent NULL dereference if group has no members
Fix bug #7014 (domain mode winbind crashes retriveing empty group members).
(cherry picked from commit 5fd32614f147a045aaee30ed9cf62e42ac6e30d8)
Diffstat (limited to 'source')
-rw-r--r-- | source/winbindd/winbindd_rpc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/winbindd/winbindd_rpc.c b/source/winbindd/winbindd_rpc.c index db43559436f..459a84460dc 100644 --- a/source/winbindd/winbindd_rpc.c +++ b/source/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 |