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