diff options
author | Jeremy Allison <jra@samba.org> | 2003-09-25 21:26:16 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-09-25 21:26:16 +0000 |
commit | d3b9384308e4b5130c9455b853edc4702d7af303 (patch) | |
tree | 026331069404a2dfd74d5d1443cf416d9ccaaa09 /source3/rpc_client | |
parent | 6c623b55bd023d9b2afa6ac3d69d814475a493e4 (diff) | |
download | samba-d3b9384308e4b5130c9455b853edc4702d7af303.tar.gz samba-d3b9384308e4b5130c9455b853edc4702d7af303.tar.bz2 samba-d3b9384308e4b5130c9455b853edc4702d7af303.zip |
Fix for #480. Change the interface for init_unistr2 to not take a length
but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string.
This is not the case. Count it after conversion.
Jeremy.
(This used to be commit f82c273a42f930c7152cfab84394781744815e0e)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_srvsvc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/rpc_client/cli_srvsvc.c b/source3/rpc_client/cli_srvsvc.c index 27349b7295..555703cf4d 100644 --- a/source3/rpc_client/cli_srvsvc.c +++ b/source3/rpc_client/cli_srvsvc.c @@ -138,11 +138,11 @@ WERROR cli_srvsvc_net_share_enum(struct cli_state *cli, TALLOC_CTX *mem_ctx, s = unistr2_tdup(mem_ctx, &r.ctr.share.info1[i].info_1_str.uni_netname); if (s) - init_unistr2(&info1->info_1_str.uni_netname, s, strlen(s) + 1); + init_unistr2(&info1->info_1_str.uni_netname, s, UNI_STR_TERMINATE); s = unistr2_tdup(mem_ctx, &r.ctr.share.info1[i].info_1_str.uni_remark); if (s) - init_unistr2(&info1->info_1_str.uni_remark, s, strlen(s) + 1); + init_unistr2(&info1->info_1_str.uni_remark, s, UNI_STR_TERMINATE); } @@ -166,19 +166,19 @@ WERROR cli_srvsvc_net_share_enum(struct cli_state *cli, TALLOC_CTX *mem_ctx, s = unistr2_tdup(mem_ctx, &r.ctr.share.info2[i].info_2_str.uni_netname); if (s) - init_unistr2(&info2->info_2_str.uni_netname, s, strlen(s) + 1); + init_unistr2(&info2->info_2_str.uni_netname, s, UNI_STR_TERMINATE); s = unistr2_tdup(mem_ctx, &r.ctr.share.info2[i].info_2_str.uni_remark); if (s) - init_unistr2(&info2->info_2_str.uni_remark, s, strlen(s) + 1); + init_unistr2(&info2->info_2_str.uni_remark, s, UNI_STR_TERMINATE); s = unistr2_tdup(mem_ctx, &r.ctr.share.info2[i].info_2_str.uni_path); if (s) - init_unistr2(&info2->info_2_str.uni_path, s, strlen(s) + 1); + init_unistr2(&info2->info_2_str.uni_path, s, UNI_STR_TERMINATE); s = unistr2_tdup(mem_ctx, &r.ctr.share.info2[i].info_2_str.uni_passwd); if (s) - init_unistr2(&info2->info_2_str.uni_passwd, s, strlen(s) + 1); + init_unistr2(&info2->info_2_str.uni_passwd, s, UNI_STR_TERMINATE); } break; } @@ -385,11 +385,11 @@ WERROR cli_srvsvc_net_file_enum(struct cli_state *cli, TALLOC_CTX *mem_ctx, s = unistr2_tdup(mem_ctx, &r.ctr.file.info3[i].info_3_str.uni_path_name); if (s) - init_unistr2(&info3->info_3_str.uni_path_name, s, strlen(s) + 1); + init_unistr2(&info3->info_3_str.uni_path_name, s, UNI_STR_TERMINATE); s = unistr2_tdup(mem_ctx, &r.ctr.file.info3[i].info_3_str.uni_user_name); if (s) - init_unistr2(&info3->info_3_str.uni_user_name, s, strlen(s) + 1); + init_unistr2(&info3->info_3_str.uni_user_name, s, UNI_STR_TERMINATE); } |