darshan7patel commented on PR #1650:
URL: https://github.com/apache/mynewt-nimble/pull/1650#issuecomment-1933928947

   Hi @andrzej-kaczmarek,
   
   Upon review, I noticed that instead of passing **BLE_STORE_MAX_BONDS** as 
the argument for **ble_store_util_bonded_peers** in 
**ble_gap_unpair_oldest_peer**, a hardcoded value of 1 is being used. 
Consequently, within **ble_store_iterate** called from 
**ble_store_util_bonded_peers**, the callback function 
**ble_store_util_iter_unique_peer** is invoked. It **returns 1** since 
**set->num_peers >= set->max_peers** evaluates to true, **causing an 
overflow**. As a result, it updates the set status to **BLE_HS_ENOMEM (6)** due 
to resource exhaustion. 
   
   Thus, this is the place where overflow occurred.
   
   These changes should address the resource exhaustion error and enable proper 
deletion of the oldest peer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to