1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

removed the for() loop to copy the buffer in init_unistr2_from_unistr()

Replaced with a memcpy()



Forgot to commit this a few moments ago


j-
This commit is contained in:
Gerald Carter -
parent 4ecd15cd58
commit 34d4fb54c3

View File

@ -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;
}