summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-10-25 09:42:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:10 -0500
commitf0dab6ba200587dc7af6a041b24c181d70b4cb2b (patch)
tree13d6ce67dfebc2672892a92021ca3cb72223182d /source3/rpcclient
parentbd9b6a249a6d58f37d2536de998c5b5719c3a85f (diff)
downloadsamba-f0dab6ba200587dc7af6a041b24c181d70b4cb2b.tar.gz
samba-f0dab6ba200587dc7af6a041b24c181d70b4cb2b.tar.bz2
samba-f0dab6ba200587dc7af6a041b24c181d70b4cb2b.zip
r11286: Fix a potential segfault
(This used to be commit f4c310d55624ab726e3cdc49dcc69f9162c797aa)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_lsarpc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 00ed515245..2cc1ffcca0 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -68,9 +68,8 @@ static NTSTATUS cmd_lsa_query_info_policy(struct rpc_pipe_client *cli,
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- DOM_SID *dom_sid;
+ DOM_SID *dom_sid = NULL;
struct uuid *dom_guid;
- fstring sid_str;
char *domain_name = NULL;
char *dns_name = NULL;
char *forest_name = NULL;
@@ -114,12 +113,16 @@ static NTSTATUS cmd_lsa_query_info_policy(struct rpc_pipe_client *cli,
if (!NT_STATUS_IS_OK(result))
goto done;
- sid_to_string(sid_str, dom_sid);
-
- if (domain_name)
- printf("domain %s has sid %s\n", domain_name, sid_str);
- else
+ if (domain_name) {
+ if (dom_sid == NULL) {
+ printf("got no sid for domain %s\n", domain_name);
+ } else {
+ printf("domain %s has sid %s\n", domain_name,
+ sid_string_static(dom_sid));
+ }
+ } else {
printf("could not query info for level %d\n", info_class);
+ }
if (dns_name)
printf("domain dns name is %s\n", dns_name);