summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_reg.c
diff options
context:
space:
mode:
authorMatthew Chapman <matty@samba.org>1999-02-15 05:33:30 +0000
committerMatthew Chapman <matty@samba.org>1999-02-15 05:33:30 +0000
commit2737f26ad64ee32d6ef7365dcce0a3eb881f99db (patch)
tree52dce623844dbea155cb961ad50f1edf83d8a1df /source3/rpc_client/cli_reg.c
parent0baa42bdd751b81ca6d17d1b5377a4e345936cad (diff)
downloadsamba-2737f26ad64ee32d6ef7365dcce0a3eb881f99db.tar.gz
samba-2737f26ad64ee32d6ef7365dcce0a3eb881f99db.tar.bz2
samba-2737f26ad64ee32d6ef7365dcce0a3eb881f99db.zip
Always null-terminate strings.
Also some string length and sizeof(pointer) corrections. (This used to be commit ce24191939b82985d09eabe945199f38b0fea486)
Diffstat (limited to 'source3/rpc_client/cli_reg.c')
-rw-r--r--source3/rpc_client/cli_reg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c
index 6fe48599d5..166617ff37 100644
--- a/source3/rpc_client/cli_reg.c
+++ b/source3/rpc_client/cli_reg.c
@@ -306,7 +306,7 @@ BOOL do_reg_query_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
valid_query = True;
*class_len = r_o.hdr_class.uni_max_len;
- unistr2_to_ascii(class, &r_o.uni_class, sizeof(class));
+ unistr2_to_ascii(class, &r_o.uni_class, sizeof(fstring)-1);
*num_subkeys = r_o.num_subkeys ;
*max_subkeylen = r_o.max_subkeylen ;
*max_subkeysize = r_o.max_subkeysize;
@@ -426,7 +426,7 @@ BOOL do_reg_query_info(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
{
valid_query = True;
unistr_to_ascii(type, r_o.uni_type.buffer,
- MIN(r_o.uni_type.buf_len, sizeof(type)));
+ MIN(r_o.uni_type.buf_len, sizeof(fstring)-1));
(*unk_0) = r_o.unknown_0;
(*unk_1) = r_o.unknown_1;
}
@@ -788,7 +788,7 @@ BOOL do_reg_enum_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
(*unk_1) = r_o.unknown_1;
(*unk_2) = r_o.unknown_2;
unistr_to_ascii(key_name, r_o.key_name.str.buffer,
- sizeof(key_name));
+ sizeof(fstring)-1);
(*mod_time) = nt_time_to_unix(&r_o.time);
}
}
@@ -904,7 +904,7 @@ BOOL do_reg_enum_val(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
{
valid_query = True;
(*val_type) = r_o.type;
- unistr2_to_ascii(val_name, &r_o.uni_name, sizeof(val_name));
+ unistr2_to_ascii(val_name, &r_o.uni_name, sizeof(fstring)-1);
}
}