Fix bug #5906 when running winbindd on a Samba PDC. Winbindd crash on 'getent group'.
authorDavide Sfriso <sfriso@virgilio.it>
Mon, 17 Nov 2008 23:40:43 +0000 (15:40 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 17 Nov 2008 23:40:43 +0000 (15:40 -0800)
source/winbindd/winbindd_passdb.c

index 0cf4540cfef02ee0bd0972e614740a76ce776fd0..101854ae943d56417771016bd2afca4e0b56b0b9 100644 (file)
@@ -639,13 +639,13 @@ static NTSTATUS sam_lookup_groupmem(struct winbindd_domain *domain,
                                  sid_type_lookup(lsa_names[i].type)));
                        continue;
                }
-               if (!((*names)[i] = talloc_strdup((*names),
+               if (!((*names)[num_mapped] = talloc_strdup((*names),
                                                  lsa_names[i].name))) {
                        TALLOC_FREE(tmp_ctx);
                        return NT_STATUS_NO_MEMORY;
                }
 
-               (*name_types)[i] = lsa_names[i].type;
+               (*name_types)[num_mapped] = lsa_names[i].type;
 
                num_mapped += 1;
        }