summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-01-28 16:22:04 -0500
committerPatrick Griffis <tingping@tingping.se>2016-01-28 16:22:04 -0500
commit35f97b65c1243afdf617a8327319006456bf85b0 (patch)
treea5126fcdd3894c06df5530bcd0a9fa82e122898b /src/common
parenta2c2abd60a7adce51ea6f97bc7f1017e07231a67 (diff)
Sanitize server name for log files
It could contain invalid chars or log to an arbitrary directory
Diffstat (limited to 'src/common')
-rw-r--r--src/common/text.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/text.c b/src/common/text.c
index 8cf850ba..766d2dd9 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -527,9 +527,12 @@ log_create_pathname (char *servname, char *channame, char *netname)
 		channame = log_create_filename (channame);
 	}
 
+	servname = log_create_filename (servname);
+
 	log_insert_vars (fname, sizeof (fname), prefs.hex_irc_logmask, channame, netname, servname);
 	g_free (channame);
 	g_free (netname);
+	g_free (servname);
 
 	/* insert time/date */
 	now = time (NULL);