mirror of
https://github.com/hexchat/hexchat.git
synced 2024-11-09 20:52:45 +01:00
Prevent undefined behaviour on memcpy
This commit is contained in:
parent
7d7be83216
commit
ee8926503c
@ -4677,8 +4677,10 @@ gtk_xtext_append_indent (xtext_buffer *buf,
|
||||
ent = g_malloc (left_len + right_len + 2 + sizeof (textentry));
|
||||
str = (unsigned char *) ent + sizeof (textentry);
|
||||
|
||||
if (left_len)
|
||||
memcpy (str, left_text, left_len);
|
||||
str[left_len] = ' ';
|
||||
if (right_len)
|
||||
memcpy (str + left_len + 1, right_text, right_len);
|
||||
str[left_len + 1 + right_len] = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user