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_dfs.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_dfs.c')
-rw-r--r-- | source3/rpc_parse/parse_dfs.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/rpc_parse/parse_dfs.c b/source3/rpc_parse/parse_dfs.c index ccd6d429fa..c8774932e3 100644 --- a/source3/rpc_parse/parse_dfs.c +++ b/source3/rpc_parse/parse_dfs.c @@ -80,9 +80,9 @@ BOOL init_dfs_q_dfs_remove(DFS_Q_DFS_REMOVE *q_d, char *entrypath, char *servername, char *sharename) { DEBUG(5,("init_dfs_q_dfs_remove\n")); - init_unistr2(&q_d->DfsEntryPath, entrypath, strlen(entrypath)+1); - init_unistr2(&q_d->ServerName, servername, strlen(servername)+1); - init_unistr2(&q_d->ShareName, sharename, strlen(sharename)+1); + init_unistr2(&q_d->DfsEntryPath, entrypath); + init_unistr2(&q_d->ServerName, servername); + init_unistr2(&q_d->ShareName, sharename); q_d->ptr_ServerName = q_d->ptr_ShareName = 1; return True; } @@ -154,11 +154,11 @@ BOOL init_dfs_q_dfs_add(DFS_Q_DFS_ADD *q_d, char *entrypath, char *servername, { DEBUG(5,("init_dfs_q_dfs_add\n")); q_d->ptr_DfsEntryPath = q_d->ptr_ServerName = q_d->ptr_ShareName = 1; - init_unistr2(&q_d->DfsEntryPath, entrypath, strlen(entrypath)+1); - init_unistr2(&q_d->ServerName, servername, strlen(servername)+1); - init_unistr2(&q_d->ShareName, sharename, strlen(sharename)+1); + init_unistr2(&q_d->DfsEntryPath, entrypath); + init_unistr2(&q_d->ServerName, servername); + init_unistr2(&q_d->ShareName, sharename); if(comment != NULL) { - init_unistr2(&q_d->Comment, comment, strlen(comment)+1); + init_unistr2(&q_d->Comment, comment); q_d->ptr_Comment = 1; } else { q_d->ptr_Comment = 0; @@ -236,9 +236,9 @@ BOOL init_dfs_q_dfs_get_info(DFS_Q_DFS_GET_INFO *q_d, char *entrypath, uint32 info_level) { DEBUG(5,("init_dfs_q2_get_info\n")); - init_unistr2(&q_d->uni_path, entrypath, strlen(entrypath)+1); - init_unistr2(&q_d->uni_server, servername, strlen(servername)+1); - init_unistr2(&q_d->uni_share, sharename, strlen(sharename)+1); + init_unistr2(&q_d->uni_path, entrypath); + init_unistr2(&q_d->uni_server, servername); + init_unistr2(&q_d->uni_share, sharename); q_d->level = info_level; q_d->ptr_server = q_d->ptr_share = 1; return True; |