diff options
author | Szymon Janc <szymon.janc@codecoup.pl> | 2018-03-22 21:07:55 +0100 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2018-03-23 13:19:06 +0200 |
commit | 89564618f472a1bf3c13ef6f5e519dbabbe90570 (patch) | |
tree | 4535ffdb723e15c570cc73622dc28c9d0e63804d | |
parent | 806ba442da966a253245f2719f36c6fc1b83be9c (diff) | |
download | bluez-89564618f472a1bf3c13ef6f5e519dbabbe90570.tar.gz |
gatt: Fail to register service with invalid Includes property
This is optional property but if it is present it must be of
proper type.
-rw-r--r-- | src/gatt-database.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gatt-database.c b/src/gatt-database.c index a22fc3b85..19f03c544 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -1676,6 +1676,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; @@ -2682,8 +2683,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); |