wsutil: return false if NULL is asked as profile name (CID: 1405202).
authorDario Lombardo <lomato@gmail.com>
Wed, 3 Jan 2018 11:08:49 +0000 (12:08 +0100)
committerDario Lombardo <lomato@gmail.com>
Wed, 3 Jan 2018 16:00:52 +0000 (16:00 +0000)
Better not rely on the fact that the caller won't pass NULL. A NULL
profile would be lead to a wrong behaviour.

Change-Id: I281f0d2364af9f7b78268580dd73024b07bcba83
Reviewed-on: https://code.wireshark.org/review/25124
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
wsutil/filesystem.c

index 612ddf347ed5009804aef2b3191b88320632d835..ee6940ef46ac39e025b68b74924d779291b44680 100644 (file)
@@ -1476,6 +1476,8 @@ gboolean
 profile_exists(const gchar *profilename, gboolean global)
 {
     gchar *path = NULL, *global_path;
+    if (!profilename)
+        return FALSE;
     if (global) {
         global_path = get_global_profiles_dir();
         path = g_strdup_printf ("%s%s%s", global_path,