diff mcabber/mcabber/histolog.c @ 1864:27c42ee4b6f0

Add a safety check to user_histo_file()
author Mikael Berthe <mikael@lilotux.net>
date Sat, 03 Apr 2010 20:39:06 +0200
parents 6abca6000762
children e9773bd9dd2e
line wrap: on
line diff
--- a/mcabber/mcabber/histolog.c	Sat Apr 03 20:21:37 2010 +0200
+++ b/mcabber/mcabber/histolog.c	Sat Apr 03 20:39:06 2010 +0200
@@ -54,6 +54,10 @@
   if (!(UseFileLogging || FileLoadLogs))
     return NULL;
 
+  if (!g_strcmp0(bjid, ".") || !g_strcmp0(bjid, "..") ||
+      strchr(bjid, "/"))
+    return NULL;
+
   lowerid = g_strdup(bjid);
   if (!lowerid)
     return NULL;