summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-04-03 00:23:50 +0200
committerGünther Deschner <gd@samba.org>2008-04-03 00:27:02 +0200
commitdc2274819ea8888c6cdcdebaff56e43c3b09ba71 (patch)
tree6d07ff32e4cb6eb7fe3cdbe352fcb85e4d3d5488 /source3/rpc_client
parentb028fd3f8c99e6d36237f5a312fd0bc800b38edd (diff)
downloadsamba-dc2274819ea8888c6cdcdebaff56e43c3b09ba71.tar.gz
samba-dc2274819ea8888c6cdcdebaff56e43c3b09ba71.tar.bz2
samba-dc2274819ea8888c6cdcdebaff56e43c3b09ba71.zip
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)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_lsarpc.c14
1 files 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;