From: Volker Lendecke Date: Mon, 16 Mar 2009 12:17:04 +0000 (+0100) Subject: Fix #6130: Don't crash in winbindd_rpc lookup_groupmem() on unmapped members X-Git-Tag: tdb-1.1.5~1075^2~93 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=b29c69f45953bf099f1d4f6e6abd5726f5ac793e Fix #6130: Don't crash in winbindd_rpc lookup_groupmem() on unmapped members Thanks to François Legal for reporting this bug --- diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index 0070bde2cc2..2c0222e7c58 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; rname, - 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;