kdbus: svace fix 78/186178/1 accepted/tizen/5.0/unified/20181102.024912 accepted/tizen/unified/20180813.152543 submit/tizen/20180813.021314 submit/tizen_5.0/20181101.000006
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Wed, 8 Aug 2018 02:47:31 +0000 (11:47 +0900)
committersanghyeok.oh <sanghyeok.oh@samsung.com>
Wed, 8 Aug 2018 02:47:43 +0000 (11:47 +0900)
Change-Id: I5618c10d9c6c2daa6cbd9c8285becf154d667c44
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
gio/gkdbus.c

index ba12aa7..24f2f3a 100755 (executable)
@@ -2161,6 +2161,18 @@ _g_kdbus_subscribe_name_acquired (GKDBusWorker  *worker,
       return FALSE;
     }
 
+  if (name != NULL)
+    {
+      if (!g_dbus_is_name (name))
+        {
+          g_set_error (error,
+                       G_DBUS_ERROR,
+                       G_DBUS_ERROR_MATCH_RULE_INVALID,
+                       "Invalid rule: %s", match_rule);
+          return FALSE;
+        }
+    }
+
   match = match_new (match_rule);
   if (!match)
     {
@@ -2244,6 +2256,18 @@ _g_kdbus_subscribe_name_lost (GKDBusWorker  *worker,
       return FALSE;
     }
 
+  if (name != NULL)
+    {
+      if (!g_dbus_is_name (name))
+        {
+          g_set_error (error,
+                       G_DBUS_ERROR,
+                       G_DBUS_ERROR_MATCH_RULE_INVALID,
+                       "Invalid rule: %s", match_rule);
+          return FALSE;
+        }
+    }
+
   match = match_new (match_rule);
   if (!match)
     {