summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_parse/parse_misc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 73ea4b10d2..1cc072b7b5 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -906,13 +906,12 @@ void init_unistr2_from_unistr (UNISTR2 *to, UNISTR *from)
if (!parse_misc_talloc)
parse_misc_talloc = talloc_init();
+ /* copy the string now */
to->buffer = (uint16 *)talloc(parse_misc_talloc, sizeof(uint16)*(to->uni_str_len));
if (to->buffer == NULL)
smb_panic("init_unistr2_from_unistr: malloc fail\n");
- for (i=0; i < to->uni_str_len; i++)
- to->buffer[i] = from->buffer[i];
-
+ memcpy( to->buffer, from->buffer, to->uni_str_len*sizeof(uint16) );
return;
}