From 73ef029935376f1aba6b20400d6a9b419eeaa5ac Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 30 Jan 2017 17:03:15 +0100 Subject: [PATCH] nimble/gatts: Fix use of uninitialized variable new_notification was set to 1 only on complete iteration of loop. If ble_hs_conn_find_by_idx would return NULL on first iteration it would be used uninitialized X-Original-Commit: 3f1ea82ac4ef1043f595ccc7ded14d57279efa62 --- nimble/host/src/ble_gatts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/host/src/ble_gatts.c b/nimble/host/src/ble_gatts.c index ae9f3fb2c..39bf35029 100644 --- a/nimble/host/src/ble_gatts.c +++ b/nimble/host/src/ble_gatts.c @@ -1443,7 +1443,7 @@ ble_gatts_chr_updated(uint16_t chr_val_handle) struct ble_store_key_cccd cccd_key; struct ble_gatts_clt_cfg *clt_cfg; struct ble_hs_conn *conn; - int new_notifications; + int new_notifications = 0; int clt_cfg_idx; int persist; int rc;