Skip to content

Commit b7c44b9

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

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
@@ -766,7 +766,7 @@ size_t NimBLEDevice::getWhiteListCount() {
766766
* @returns The NimBLEAddress at the whitelist index or null address if not found.
767767
*/
768768
NimBLEAddress NimBLEDevice::getWhiteListAddress(size_t index) {
769-
if (index > m_whiteList.size()) {
769+
if (index >= m_whiteList.size()) {
770770
NIMBLE_LOGE(LOG_TAG, "Invalid index; %u", index);
771771
return NimBLEAddress{};
772772
}

0 commit comments

Comments
 (0)