1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 06:26:44 +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

@ -214,8 +214,11 @@ static void chat_onStatusMessageChange(ToxWindow *self, int32_t num, uint8_t *st
return;
StatusBar *statusbar = self->stb;
status[len] = '\0';
snprintf(statusbar->statusmsg, sizeof(statusbar->statusmsg), "%s", status);
len = strlen(statusbar->statusmsg);
statusbar->statusmsg_len = len;
strcpy(statusbar->statusmsg, status);
statusbar->statusmsg[len] = '\0';
}