about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2013-01-04 19:33:12 +0200
committerDmitry Podgorny <pasis.ua@gmail.com>2013-01-04 19:33:12 +0200
commitf1eaf3e144bfab2670b4bd4d36ab851168ff9bb8 (patch)
tree6312ebd65c465546676e03b29439426cf0c18596
parenta626f80117b10750e2ff6836caf9a3c3c434eb10 (diff)
downloadprofani-tty-f1eaf3e144bfab2670b4bd4d36ab851168ff9bb8.tar.gz
fix possible buffer overflow in _ui_draw_win_title
-rw-r--r--src/windows.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/windows.c b/src/windows.c
index b8b12f59..ae00ee54 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -177,12 +177,12 @@ _ui_draw_win_title(void)
         gint unread = _win_get_unread();
 
         if (unread != 0) {
-            sprintf(new_win_title, "%c]0;%s%s (%d) - %s%c", '\033', "Profanity", version_str->str, unread, jid, '\007');
+            snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s (%d) - %s%c", '\033', "Profanity", version_str->str, unread, jid, '\007');
         } else {
-            sprintf(new_win_title, "%c]0;%s%s - %s%c", '\033', "Profanity", version_str->str, jid, '\007');
+            snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s - %s%c", '\033', "Profanity", version_str->str, jid, '\007');
         }
     } else {
-        sprintf(new_win_title, "%c]0;%s%s%c", '\033', "Profanity", version_str->str, '\007');
+        snprintf(new_win_title, sizeof(new_win_title), "%c]0;%s%s%c", '\033', "Profanity", version_str->str, '\007');
     }
 
     g_string_free(version_str, TRUE);