From 6c39789e6f1e7003713e6371fc1d1fd610538b2d Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 8 Jan 2004 22:21:29 +0000 Subject: fix segfault when sid_ptr == 0 in DsEnumDomainTrusts() reply (This used to be commit ba9dc0d9fd3e30a7ddf97b6a4df753db7ba12cc1) --- source3/nsswitch/winbindd_util.c | 5 ++--- source3/rpc_client/cli_ds.c | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'source3') diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index 29a4ca93eb..076ab1a2fc 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -123,8 +123,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const /* Create new domain entry */ - if ((domain = (struct winbindd_domain *) - malloc(sizeof(*domain))) == NULL) + if ((domain = (struct winbindd_domain *)malloc(sizeof(*domain))) == NULL) return NULL; /* Fill in fields */ @@ -164,7 +163,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const DEBUG(1,("Added domain %s %s %s\n", domain->name, domain->alt_name, - sid?sid_string_static(&domain->sid):"")); + &domain->sid?sid_string_static(&domain->sid):"")); return domain; } diff --git a/source3/rpc_client/cli_ds.c b/source3/rpc_client/cli_ds.c index f8455edcd9..8c2821d5af 100644 --- a/source3/rpc_client/cli_ds.c +++ b/source3/rpc_client/cli_ds.c @@ -127,19 +127,19 @@ NTSTATUS cli_ds_enum_domain_trusts(struct cli_state *cli, TALLOC_CTX *mem_ctx, (*trusts)[i].trust_attributes = r.domains.trusts[i].trust_attributes; (*trusts)[i].guid = r.domains.trusts[i].guid; - if (&r.domains.trusts[i].sid_ptr) { + if (r.domains.trusts[i].sid_ptr) { sid_copy(&(*trusts)[i].sid, &r.domains.trusts[i].sid.sid); } else { ZERO_STRUCT((*trusts)[i].sid); } - if (&r.domains.trusts[i].netbios_ptr) { + if (r.domains.trusts[i].netbios_ptr) { (*trusts)[i].netbios_domain = unistr2_tdup( mem_ctx, &r.domains.trusts[i].netbios_domain ); } else { (*trusts)[i].netbios_domain = NULL; } - if (&r.domains.trusts[i].dns_ptr) { + if (r.domains.trusts[i].dns_ptr) { (*trusts)[i].dns_domain = unistr2_tdup( mem_ctx, &r.domains.trusts[i].dns_domain ); } else { (*trusts)[i].dns_domain = NULL; -- cgit