Skip to content

Commit 04a7a79

Browse files
Copilotdoudar
authored andcommitted
[Bugfix] whitelist bounds checks
Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
1 parent 540ebfc commit 04a7a79

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/NimBLEDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ size_t NimBLEDevice::getWhiteListCount() {
762762
* @returns The NimBLEAddress at the whitelist index or null address if not found.
763763
*/
764764
NimBLEAddress NimBLEDevice::getWhiteListAddress(size_t index) {
765-
if (index > m_whiteList.size()) {
765+
if (index >= m_whiteList.size()) {
766766
NIMBLE_LOGE(LOG_TAG, "Invalid index; %u", index);
767767
return NimBLEAddress{};
768768
}

0 commit comments

Comments
 (0)