1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-03 06:16:45 +02:00

fix another possible buffer overflow

..
This commit is contained in:
Jfreegman
2014-06-01 13:36:23 -04:00
parent 848b4e9a4c
commit 7206a9ea73
3 changed files with 10 additions and 5 deletions

View File

@ -74,7 +74,7 @@ void prompt_update_nick(ToxWindow *prompt, uint8_t *nick, uint16_t len)
{
StatusBar *statusbar = prompt->stb;
snprintf(statusbar->nick, sizeof(statusbar->nick), "%s", nick);
statusbar->nick_len = len;
statusbar->nick_len = strlen(statusbar->nick);
}
/* Updates own statusmessage in prompt statusbar */
@ -82,7 +82,7 @@ void prompt_update_statusmessage(ToxWindow *prompt, uint8_t *statusmsg, uint16_t
{
StatusBar *statusbar = prompt->stb;
snprintf(statusbar->statusmsg, sizeof(statusbar->statusmsg), "%s", statusmsg);
statusbar->statusmsg_len = len;
statusbar->statusmsg_len = strlen(statusbar->statusmsg);
}
/* Updates own status in prompt statusbar */