summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-03-16 13:17:04 +0100
committerKarolin Seeger <kseeger@samba.org>2009-03-27 13:06:53 +0100
commit3f19b0a34ee51ff0e0bfe930d6e8b2cbc2d96893 (patch)
tree2e3ffc48c994c9c7d8eaae079d1bea48ce7d706a
parentffe74bbbc403a75e40784500f250421c7d8f5d83 (diff)
downloadsamba-3f19b0a34ee51ff0e0bfe930d6e8b2cbc2d96893.tar.gz
samba-3f19b0a34ee51ff0e0bfe930d6e8b2cbc2d96893.tar.xz
samba-3f19b0a34ee51ff0e0bfe930d6e8b2cbc2d96893.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 (cherry picked from commit e6a23d498bfd4bbe19cecf24ba3f94af83c9bf8b)
-rw-r--r--source/winbindd/winbindd_rpc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/winbindd/winbindd_rpc.c b/source/winbindd/winbindd_rpc.c
index b03e035900e..f6a9c666bcf 100644
--- a/source/winbindd/winbindd_rpc.c
+++ b/source/winbindd/winbindd_rpc.c
@@ -821,14 +821,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;