mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
_win_notify_remind: fix possible buffer overflow
fix buffer overflow when 'unread' is greater than 999
This commit is contained in:
parent
d234a71770
commit
52751d16aa
@ -567,7 +567,7 @@ _win_notify_remind(gint unread)
|
|||||||
if (unread == 1) {
|
if (unread == 1) {
|
||||||
sprintf(message, "1 unread message");
|
sprintf(message, "1 unread message");
|
||||||
} else {
|
} else {
|
||||||
sprintf(message, "%d unread messages", unread);
|
snprintf(message, sizeof(message), "%d unread messages", unread);
|
||||||
}
|
}
|
||||||
|
|
||||||
_win_notify(message, 5000, "Incoming message");
|
_win_notify(message, 5000, "Incoming message");
|
||||||
|
Loading…
Reference in New Issue
Block a user