gatt: Fail to register service with invalid Includes property 56/204956/1
authorSzymon Janc <szymon.janc@codecoup.pl>
Thu, 22 Mar 2018 20:07:55 +0000 (21:07 +0100)
committerAmit Purwar <amit.purwar@samsung.com>
Fri, 26 Apr 2019 10:53:53 +0000 (16:23 +0530)
This is optional property but if it is present it must be of
proper type.

Change-Id: I0a144bc7ce0e7b55a5f8ba0f94d7608397491dfa
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
src/gatt-database.c

index 2ba6f15..fd0e00b 100644 (file)
@@ -2029,6 +2029,7 @@ static bool parse_includes(GDBusProxy *proxy, struct external_service *service)
        DBusMessageIter array;
        char *obj;
 
+       /* Includes property is optional */
        if (!g_dbus_proxy_get_property(proxy, "Includes", &iter))
                return true;
 
@@ -3228,8 +3229,10 @@ static bool database_add_service(struct external_service *service)
                return false;
        }
 
-       if (!parse_includes(service->proxy, service))
+       if (!parse_includes(service->proxy, service)) {
                error("Failed to read \"Includes\" property of service");
+               return false;
+       }
 
        service->attrib = gatt_db_add_service(service->app->database->db, &uuid,
                                                primary, service->attr_cnt);