core/gatt-database: Fix endless loop
Luiz Augusto von Dentz
maintainerPATCH 1/1 core/gatt-database: Fix endless loop
From: Luiz Augusto von Dentz <[email protected]>
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(-)
src/gatt-database.c +2 -1
@@ -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; }
Signature · 1 line
2.1.0
Hi,
Quoted 31 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
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(-)src/gatt-database.c +2
-2@@ -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; } --
Quoted 1 line
2.1.0
Applied.
Signature · 1 line
Luiz Augusto von Dentz