diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-01-17 04:58:45 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-01-17 04:58:45 +0000 |
commit | ec879eacc263043409b584797d1e8c39258ba125 (patch) | |
tree | 7a7775040b27f7fea0f7bd1c8f0ede91c9ce770d /source3/rpc_parse/parse_lsa.c | |
parent | ba51d1d888f98e196627486490e8569faeb641c2 (diff) | |
download | samba-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_parse/parse_lsa.c')
-rw-r--r-- | source3/rpc_parse/parse_lsa.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index 7c9f74da37..d37a27a97f 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -43,7 +43,7 @@ void init_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name, trn->sid_name_use = sid_name_use; init_uni_hdr(&trn->hdr_name, len_name); - init_unistr2(uni_name, name, len_name); + init_unistr2(uni_name, name); trn->domain_idx = idx; } @@ -346,8 +346,7 @@ void init_q_open_pol2(LSA_Q_OPEN_POL2 *r_q, const char *server_name, r_q->des_access = desired_access; - init_unistr2(&r_q->uni_server_name, server_name, - strlen(server_name) + 1); + init_unistr2(&r_q->uni_server_name, server_name); init_lsa_obj_attr(&r_q->attr, attributes, qos); } @@ -1091,7 +1090,7 @@ void init_q_lookup_names(TALLOC_CTX *mem_ctx, LSA_Q_LOOKUP_NAMES *q_l, len = strlen(names[i]); init_uni_hdr(&q_l->hdr_name[i], len); - init_unistr2(&q_l->uni_name[i], names[i], len); + init_unistr2(&q_l->uni_name[i], names[i]); } } @@ -1444,7 +1443,7 @@ void init_lsa_priv_get_dispname(LSA_Q_PRIV_GET_DISPNAME *trn, POLICY_HND *hnd, c memcpy(&trn->pol, hnd, sizeof(trn->pol)); init_uni_hdr(&trn->hdr_name, len_name); - init_unistr2(&trn->name, name, len_name); + init_unistr2(&trn->name, name); trn->lang_id = lang_id; trn->lang_id_sys = lang_id_sys; } @@ -1957,7 +1956,7 @@ void init_lsa_q_lookupprivvalue(LSA_Q_LOOKUPPRIVVALUE *trn, POLICY_HND *hnd, con len_name = 1; init_uni_hdr(&trn->hdr_right, len_name); - init_unistr2(&trn->uni2_right, name, len_name); + init_unistr2(&trn->uni2_right, name); } /******************************************************************* |