r4216: fix segfault in idmap_rid
authorGünther Deschner <gd@samba.org>
Wed, 15 Dec 2004 10:12:10 +0000 (10:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:37 +0000 (10:53 -0500)
(only ever shows up when the somewhat hidden
IDMAP_RID_SUPPORT_TRUSTED_DOMAINS - define is set).

Thanks to Stephan Martin <sm@suse.de> for reporting this bug.

Guenther

source/sam/idmap_rid.c

index 48b38fb0d852cfc9b16e9ac5bd6cc92375757e02..8a50839c7ef5254aa8a90e3c1ceb3c827764f16e 100644 (file)
@@ -272,8 +272,8 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name
 
        /* put the results together */
        *num_domains = trusted_num_domains + 1;
-       *domain_names = (fstring *) realloc(domain_names, sizeof(fstring) * *num_domains);
-       *domain_sids = (DOM_SID *) realloc(domain_sids, sizeof(DOM_SID) * *num_domains); 
+       *domain_names = (fstring *) realloc(*domain_names, sizeof(fstring) * *num_domains);
+       *domain_sids = (DOM_SID *) realloc(*domain_sids, sizeof(DOM_SID) * *num_domains); 
 
        /* first add myself at the end*/
        fstrcpy((*domain_names)[0], domain_name);