diff options
author | TingPing <tingping@tingping.se> | 2014-12-10 09:32:16 -0500 |
---|---|---|
committer | TingPing <tingping@tingping.se> | 2014-12-10 09:32:16 -0500 |
commit | 10246f121a9dfb1fe38012aa92324ac6050822a2 (patch) | |
tree | af15e7f6931dbe346c1d6fdef8a2cf7d539e7984 /src/fe-gtk | |
parent | 025152ee53b56861e9738b2218743af28c5f1e45 (diff) |
Fix unsafe string handling in configs
Also fixes 2 leaks
Diffstat (limited to 'src/fe-gtk')
-rw-r--r-- | src/fe-gtk/servlistgui.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c index f43a225a..6117899d 100644 --- a/src/fe-gtk/servlistgui.c +++ b/src/fe-gtk/servlistgui.c @@ -960,10 +960,10 @@ servlist_savegui (void) if (!rfc_casecmp (nick1, nick2)) return 2; - strcpy (prefs.hex_irc_nick1, nick1); - strcpy (prefs.hex_irc_nick2, nick2); - strcpy (prefs.hex_irc_nick3, gtk_entry_get_text (GTK_ENTRY (entry_nick3))); - strcpy (prefs.hex_irc_user_name, gtk_entry_get_text (GTK_ENTRY (entry_guser))); + safe_strcpy (prefs.hex_irc_nick1, nick1, sizeof(prefs.hex_irc_nick1)); + safe_strcpy (prefs.hex_irc_nick2, nick2, sizeof(prefs.hex_irc_nick2)); + safe_strcpy (prefs.hex_irc_nick3, gtk_entry_get_text (GTK_ENTRY (entry_nick3)), sizeof(prefs.hex_irc_nick3)); + safe_strcpy (prefs.hex_irc_user_name, gtk_entry_get_text (GTK_ENTRY (entry_guser)), sizeof(prefs.hex_irc_user_name)); sp = strchr (prefs.hex_irc_user_name, ' '); if (sp) sp[0] = 0; /* spaces will break the login */ |