diff options
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 15 | ||||
-rw-r--r-- | source3/rpc_parse/parse_rpc.c | 7 | ||||
-rw-r--r-- | source3/rpc_parse/parse_spoolss.c | 2 |
3 files changed, 11 insertions, 13 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index 4b118dd2b4..216a6e2eca 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -539,8 +539,7 @@ void init_unistr(UNISTR *str, const char *buf) if (str->buffer == NULL) smb_panic("init_unistr: malloc fail\n"); - /* store the string (null-terminated copy) */ - dos_struni2((char *)str->buffer, buf, len); + rpcstr_push(str->buffer, buf, len, STR_TERMINATE); } /******************************************************************* @@ -605,12 +604,12 @@ void init_buffer3_str(BUFFER3 *str, char *buf, int len) /* set up string lengths. */ str->buf_max_len = len * 2; - str->buf_len = len * 2; + str->buf_len = len * 2; create_buffer3(str, str->buf_max_len); - /* store the string (null-terminated 8 bit chars into 16 bit chars) */ - dos_struni2((char *)str->buffer, buf, str->buf_max_len); + rpcstr_push(str->buffer, buf, str->buf_max_len, STR_TERMINATE); + } /******************************************************************* @@ -911,8 +910,7 @@ void init_unistr2(UNISTR2 *str, const char *buf, size_t len) return; } - /* store the string (null-terminated 8 bit chars into 16 bit chars) */ - dos_struni2((char *)str->buffer, buf, len); + rpcstr_push((char *)str->buffer, buf, len, STR_TERMINATE); } /******************************************************************* @@ -1483,8 +1481,7 @@ void init_unistr3(UNISTR3 *str, const char *buf) if (str->str.buffer == NULL) smb_panic("init_unistr3: malloc fail\n"); - /* store the string (null-terminated copy) */ - dos_struni2((char *)str->str.buffer, buf, len); + rpcstr_push((char *)str->str.buffer, buf, len, STR_TERMINATE); } /******************************************************************* diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index f330c5947e..a60bad0aa2 100644 --- a/source3/rpc_parse/parse_rpc.c +++ b/source3/rpc_parse/parse_rpc.c @@ -877,14 +877,15 @@ void init_rpc_auth_ntlmssp_resp(RPC_AUTH_NTLMSSP_RESP *rsp, memcpy(rsp->nt_resp, nt_resp, 24); if (neg_flags & NTLMSSP_NEGOTIATE_UNICODE) { - dos_struni2(rsp->domain, domain, sizeof(rsp->domain)); - dos_struni2(rsp->user, user, sizeof(rsp->user)); - dos_struni2(rsp->wks, wks, sizeof(rsp->wks)); + rpcstr_push(rsp->domain, domain, sizeof(rsp->domain), 0); + rpcstr_push(rsp->user, user, sizeof(rsp->user), 0); + rpcstr_push(rsp->wks, wks, sizeof(rsp->wks), 0); } else { fstrcpy(rsp->domain, domain); fstrcpy(rsp->user, user); fstrcpy(rsp->wks, wks); } + rsp->sess_key[0] = 0; } diff --git a/source3/rpc_parse/parse_spoolss.c b/source3/rpc_parse/parse_spoolss.c index 2b81a7708c..b303bf108e 100644 --- a/source3/rpc_parse/parse_spoolss.c +++ b/source3/rpc_parse/parse_spoolss.c @@ -4713,7 +4713,7 @@ static BOOL uniarray_2_dosarray(BUFFER5 *buf5, fstring **ar) *ar = NULL; while (src < ((char *)buf5->buffer) + buf5->buf_len*2) { - unistr_to_dos(f, src, sizeof(f)-1); + rpcstr_pull(f, src, sizeof(f)-1, -1, 0); src = skip_unibuf(src, 2*buf5->buf_len - PTR_DIFF(src,buf5->buffer)); *ar = (fstring *)Realloc(*ar, sizeof(fstring)*(n+2)); fstrcpy((*ar)[n], f); |