diff options
author | Volker Lendecke <vl@samba.org> | 2009-03-16 13:17:04 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-03-17 21:19:32 +0100 |
commit | b29c69f45953bf099f1d4f6e6abd5726f5ac793e (patch) | |
tree | 30bb254de4bcf334af00ac92e329936dd8d04615 /source3/winbindd | |
parent | e95d0b548e344dbc8cb3dd0a0f29854711bd0cac (diff) | |
download | samba-b29c69f45953bf099f1d4f6e6abd5726f5ac793e.tar.gz samba-b29c69f45953bf099f1d4f6e6abd5726f5ac793e.tar.bz2 samba-b29c69f45953bf099f1d4f6e6abd5726f5ac793e.zip |
Fix #6130: Don't crash in winbindd_rpc lookup_groupmem() on unmapped members
Thanks to François Legal <devel@thom.fr.eu.org> for reporting this bug
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd_rpc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index 0070bde2cc..2c0222e7c5 100644 --- a/source3/winbindd/winbindd_rpc.c +++ b/source3/winbindd/winbindd_rpc.c @@ -857,14 +857,15 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, } for (r=0; r<tmp_names.count; r++) { - (*names)[i+r] = fill_domain_username_talloc(mem_ctx, - domain->name, - tmp_names.names[r].string, - true); - (*name_types)[i+r] = tmp_types.ids[r]; + if (tmp_types.ids[r] == SID_NAME_UNKNOWN) { + continue; + } + (*names)[total_names] = fill_domain_username_talloc( + mem_ctx, domain->name, + tmp_names.names[r].string, true); + (*name_types)[total_names] = tmp_types.ids[r]; + total_names += 1; } - - total_names += tmp_names.count; } *num_names = total_names; |