diff options
author | Matthew Chapman <matty@samba.org> | 1999-02-15 05:33:30 +0000 |
---|---|---|
committer | Matthew Chapman <matty@samba.org> | 1999-02-15 05:33:30 +0000 |
commit | 2737f26ad64ee32d6ef7365dcce0a3eb881f99db (patch) | |
tree | 52dce623844dbea155cb961ad50f1edf83d8a1df /source3/rpc_parse | |
parent | 0baa42bdd751b81ca6d17d1b5377a4e345936cad (diff) | |
download | samba-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_parse')
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_reg.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_rpc.c | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index 04a9ba4544..12501a5e57 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -328,7 +328,7 @@ creates a UNISTR structure. ********************************************************************/ void make_unistr(UNISTR *str, char *buf) { - ascii_to_unistr(str->buffer, buf, sizeof(str->buffer)); + ascii_to_unistr(str->buffer, buf, sizeof(str->buffer)-1); } /******************************************************************* diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c index 3aa9bbbc2a..8072ed2a64 100644 --- a/source3/rpc_parse/parse_reg.c +++ b/source3/rpc_parse/parse_reg.c @@ -771,7 +771,7 @@ void make_reg_r_info(REG_R_INFO *r_r, char buf[512]; int len; - len = ascii_to_unibuf(buf, os_type, sizeof(buf)) - buf; + len = ascii_to_unibuf(buf, os_type, sizeof(buf)-2) - buf; r_r->ptr1 = 1; r_r->level = level; diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index c4a7e35895..9716b35b78 100644 --- a/source3/rpc_parse/parse_rpc.c +++ b/source3/rpc_parse/parse_rpc.c @@ -707,9 +707,9 @@ void make_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, if (IS_BITS_SET_ALL(neg_flags, NTLMSSP_NEGOTIATE_UNICODE)) { - ascii_to_unibuf(rsp->domain, domain, sizeof(rsp->domain)); - ascii_to_unibuf(rsp->user , user , sizeof(rsp->user )); - ascii_to_unibuf(rsp->wks , wks , sizeof(rsp->wks )); + ascii_to_unibuf(rsp->domain, domain, sizeof(rsp->domain)-2); + ascii_to_unibuf(rsp->user , user , sizeof(rsp->user )-2); + ascii_to_unibuf(rsp->wks , wks , sizeof(rsp->wks )-2); } else { |