From dc2274819ea8888c6cdcdebaff56e43c3b09ba71 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 3 Apr 2008 00:23:50 +0200 Subject: Fix rpccli_lsa_lookup_sids_noalloc. When looking up e.g. a trusted doamin account, there is just no name. Michael, please check. Guenther (This used to be commit ea3cfadc2504c891b4784719bd8e6debcc38c879) --- source3/rpc_client/cli_lsarpc.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 3d57e22f42..37387a04dd 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -203,11 +203,19 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli, dom_name = ref_domains->domains[dom_idx].name.string; name = lsa_names.names[i].name.string; - (names)[i] = talloc_strdup(mem_ctx, name); + if (name) { + (names)[i] = talloc_strdup(mem_ctx, name); + if ((names)[i] == NULL) { + DEBUG(0, ("cli_lsa_lookup_sids_noalloc(): out of memory\n")); + result = NT_STATUS_UNSUCCESSFUL; + goto done; + } + } else { + (names)[i] = NULL; + } (domains)[i] = talloc_strdup(mem_ctx, dom_name); (types)[i] = lsa_names.names[i].sid_type; - - if (((names)[i] == NULL) || ((domains)[i] == NULL)) { + if (((domains)[i] == NULL)) { DEBUG(0, ("cli_lsa_lookup_sids_noalloc(): out of memory\n")); result = NT_STATUS_UNSUCCESSFUL; goto done; -- cgit