Fix gum-utils segfault when getting user list without usertypes 38/39638/1
authorSuchang Woo <suchang.woo@samsung.com>
Wed, 20 May 2015 07:54:30 +0000 (16:54 +0900)
committerSuchang Woo <suchang.woo@samsung.com>
Wed, 20 May 2015 08:17:59 +0000 (17:17 +0900)
If usertypes argument is not specified, NULL is passed to g_strsplit().
It makes a segmentation fault.

Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
Change-Id: I56d35a0afe9afadb5cdb592c546ca88554fa4951

src/utils/gumd-utils.c

index c18d03b..1df8c75 100644 (file)
@@ -378,7 +378,11 @@ _handle_user_get_list (
     service = gum_user_service_create_sync (offline_mode);
     if (!service) return;
 
-    strv = g_strsplit (types, ",", -1);
+    if (types)
+         strv = g_strsplit (types, ",", -1);
+    else
+         strv = g_malloc0 (sizeof (gchar *));
+
     users = gum_user_service_get_user_list_sync (service,
             (const gchar *const *)strv);
     g_strfreev (strv);