Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit 392128b

Browse files
sandeepmistryarfoll
authored andcommitted
Fix segfault in lb_get_ble_characteristic_by_uuid
Occurs when the first service characteristic UUID doesn't match. Signed-off-by: Sandeep Mistry <[email protected]> Signed-off-by: Brendan Le Foll <[email protected]>
1 parent 0d4b841 commit 392128b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/littleb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ lb_get_ble_characteristic_by_uuid(lb_bl_device* dev, const char* uuid, lb_ble_ch
11211121
}
11221122

11231123
for (i = 0; i < dev->services_size; i++) {
1124-
for (j = 0; dev->services_size; j++) {
1124+
for (j = 0; j < dev->services[i]->characteristics_size; j++) {
11251125
if (strncmp(uuid, dev->services[i]->characteristics[j]->uuid, strlen(uuid)) == 0) {
11261126
*ble_characteristic_ret = dev->services[i]->characteristics[j];
11271127
return LB_SUCCESS;

0 commit comments

Comments
 (0)