From 91d66daa49b19ea2f97762bf56c00474b9914fcf Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 13 Apr 2015 15:06:27 +0300 Subject: [PATCH] core/gatt-database: Fix endless loop The descriptors list may contain descriptors from another services which should be ignored but the code did not iterate to next item causing an endless loop if that happen. --- src/gatt-database.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gatt-database.c b/src/gatt-database.c index bbeb7cdd5..f182fd026 100644 --- a/src/gatt-database.c +++ b/src/gatt-database.c @@ -1964,7 +1964,7 @@ static bool database_add_chrc(struct external_service *service, struct external_desc *desc = entry->data; if (desc->handled || g_strcmp0(desc->chrc_path, chrc->path)) - continue; + goto next; if (!database_add_desc(service, desc)) { chrc->attrib = NULL; @@ -1972,6 +1972,7 @@ static bool database_add_chrc(struct external_service *service, return false; } +next: entry = entry->next; } -- 2.47.3