mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-12 16:50:19 +00:00
Fix unsafe string handling in configs
Also fixes 2 leaks
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user