From 223177edbb7636b40e55c8dfe20a9ba08209cce2 Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Wed, 3 Sep 2014 13:26:28 -0700 Subject: [PATCH] shared/gatt-client: Fix invalid access during descriptor discovery. This patch fixes an off-by-one error during descriptor discovery, which results in an invalid access if more than one descriptor declaration exists within a service handle range. --- src/shared/gatt-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index 101e47eec..1a157ecf4 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -229,7 +229,7 @@ static void discover_descs_cb(bool success, uint8_t att_ecode, op->cur_chrc->num_descs = desc_count; op->cur_chrc->descs = descs; - for (i = op->cur_chrc_index; + for (i = op->cur_chrc_index + 1; i < op->cur_service->service.num_chrcs; i++) { op->cur_chrc_index = i; op->cur_chrc++; -- 2.47.3