Skip to content

Commit ed75be4

Browse files
Address review comment
1 parent 450f4ab commit ed75be4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/platform/ESP32/nimble/BLEManagerImpl.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,11 @@ bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBle
659659
return false;
660660
}
661661

662-
assert(pBuf->DataLength() <= UINT16_MAX);
662+
if (pBuf->DataLength() > UINT16_MAX)
663+
{
664+
ChipLogError(Ble, "Buffer data Length is too long");
665+
return false;
666+
}
663667
rc = ble_gattc_write_flat(conId, chr->chr.val_handle, pBuf->Start(), static_cast<uint16_t>(pBuf->DataLength()), OnWriteComplete,
664668
this);
665669
if (rc != 0)

0 commit comments

Comments
 (0)