Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jadhavrohit924 committed Jun 28, 2024
1 parent 450f4ab commit ed75be4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/platform/ESP32/nimble/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,11 @@ bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBle
return false;
}

assert(pBuf->DataLength() <= UINT16_MAX);
if (pBuf->DataLength() > UINT16_MAX)
{
ChipLogError(Ble, "Buffer data Length is too long");
return false;
}
rc = ble_gattc_write_flat(conId, chr->chr.val_handle, pBuf->Start(), static_cast<uint16_t>(pBuf->DataLength()), OnWriteComplete,
this);
if (rc != 0)
Expand Down

0 comments on commit ed75be4

Please sign in to comment.