We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0606e21 commit 8977376Copy full SHA for 8977376
1 file changed
src/NimBLEDevice.cpp
@@ -685,7 +685,7 @@ NimBLEAddress NimBLEDevice::getBondedAddress(int index) {
685
ble_addr_t peer_id_addrs[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
686
int num_peers, rc;
687
rc = ble_store_util_bonded_peers(&peer_id_addrs[0], &num_peers, MYNEWT_VAL(BLE_STORE_MAX_BONDS));
688
- if (rc != 0 || index > num_peers || index < 0) {
+ if (rc != 0 || index >= num_peers || index < 0) {
689
return NimBLEAddress{};
690
}
691
0 commit comments