mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 11:13:27 +01:00
Fix possible buffer overrun in python API
This commit is contained in:
parent
58d0bd0663
commit
27e20d6f44
@ -106,7 +106,7 @@ void api_send(const char *msg)
|
|||||||
|
|
||||||
self_window = get_active_window();
|
self_window = get_active_window();
|
||||||
|
|
||||||
strncpy((char *) self_window->chatwin->line, msg, sizeof(self_window->chatwin->line));
|
snprintf((char *) self_window->chatwin->line, sizeof(self_window->chatwin->line), "%s", msg);
|
||||||
add_line_to_hist(self_window->chatwin);
|
add_line_to_hist(self_window->chatwin);
|
||||||
int id = line_info_add(self_window, true, name, NULL, OUT_MSG, 0, 0, "%s", msg);
|
int id = line_info_add(self_window, true, name, NULL, OUT_MSG, 0, 0, "%s", msg);
|
||||||
cqueue_add(self_window->chatwin->cqueue, msg, strlen(msg), OUT_MSG, id);
|
cqueue_add(self_window->chatwin->cqueue, msg, strlen(msg), OUT_MSG, id);
|
||||||
|
Loading…
Reference in New Issue
Block a user