summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-01-17 04:58:45 +0000
committerAndrew Tridgell <tridge@samba.org>2003-01-17 04:58:45 +0000
commitec879eacc263043409b584797d1e8c39258ba125 (patch)
tree7a7775040b27f7fea0f7bd1c8f0ede91c9ce770d /source3/rpc_client
parentba51d1d888f98e196627486490e8569faeb641c2 (diff)
downloadsamba-ec879eacc263043409b584797d1e8c39258ba125.tar.gz
samba-ec879eacc263043409b584797d1e8c39258ba125.tar.bz2
samba-ec879eacc263043409b584797d1e8c39258ba125.zip
This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd argument incorrect, so I thought it best just to remove the argument. The incorrect usage was caused by callers using strlen() to determine the length of the string. The 3rd argument to init_unistr2() was supposed to be the character length, not the byte length of the string, so for non-english this could come out wrong. I also removed the bogus 'always allocate at least 256 bytes' hack. There may be some code that relies on this, but if there is then the code is broken and needs fixing. (This used to be commit b9eff31b1433c81fbff733e194914a40f25e3bda)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_srvsvc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/rpc_client/cli_srvsvc.c b/source3/rpc_client/cli_srvsvc.c
index 1bdd19620b..013b4a077c 100644
--- a/source3/rpc_client/cli_srvsvc.c
+++ b/source3/rpc_client/cli_srvsvc.c
@@ -142,11 +142,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);
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);
}
@@ -170,19 +170,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);
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);
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);
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);
}
break;
}
@@ -388,11 +388,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);
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);
}