summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_reg.c11
-rw-r--r--source3/rpcclient/display.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/source3/rpcclient/cmd_reg.c b/source3/rpcclient/cmd_reg.c
index 4d49d19b3b..fd5fc71828 100644
--- a/source3/rpcclient/cmd_reg.c
+++ b/source3/rpcclient/cmd_reg.c
@@ -766,17 +766,20 @@ void cmd_reg_get_key_sec(struct client_info *info)
/* query key sec info. first call sets sec_buf_size. */
sec_buf_size = 0;
+ sec_buf.sec = NULL;
+
res4 = res3 ? do_reg_get_key_sec(smb_cli, &key_pol,
&sec_buf_size, &sec_buf) : False;
res4 = res4 ? do_reg_get_key_sec(smb_cli, &key_pol,
&sec_buf_size, &sec_buf) : False;
- if (res4 && sec_buf.len > 0)
+ if (res4 && sec_buf.len > 0 && sec_buf.sec != NULL)
{
- display_sec_desc(out_hnd, ACTION_HEADER , &sec_buf.sec);
- display_sec_desc(out_hnd, ACTION_ENUMERATE, &sec_buf.sec);
- display_sec_desc(out_hnd, ACTION_FOOTER , &sec_buf.sec);
+ display_sec_desc(out_hnd, ACTION_HEADER , sec_buf.sec);
+ display_sec_desc(out_hnd, ACTION_ENUMERATE, sec_buf.sec);
+ display_sec_desc(out_hnd, ACTION_FOOTER , sec_buf.sec);
+ free(sec_buf.sec);
}
/* close the key handle */
diff --git a/source3/rpcclient/display.c b/source3/rpcclient/display.c
index c55358bc9c..c35f8db9af 100644
--- a/source3/rpcclient/display.c
+++ b/source3/rpcclient/display.c
@@ -1175,7 +1175,7 @@ void display_sec_desc(FILE *out_hnd, enum action_type action, SEC_DESC *sec)
{
case ACTION_HEADER:
{
- fprintf(out_hnd, "\tSecurity Descriptor\tunk 1,2: %x %x\n", sec->unknown_1, sec->unknown_2);
+ fprintf(out_hnd, "\tSecurity Descriptor\tunk 1: %x\n", sec->unknown_1);
fprintf(out_hnd, "\t-------------------\n");
break;