1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

_win_notify_remind: fix possible buffer overflow

fix buffer overflow when 'unread' is greater than 999
This commit is contained in:
Dmitry Podgorny 2012-11-16 14:07:31 +02:00
parent d234a71770
commit 52751d16aa

View File

@ -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");