fix(nimble): Added a check for invalid offset

This commit is contained in:
Shreeyash
2024-12-17 16:28:41 +05:30
committed by Rahul Tank
parent 47bf57530c
commit 99cb42bc13
+5
View File
@@ -4228,6 +4228,11 @@ ble_gattc_write_long(uint16_t conn_handle, uint16_t attr_handle,
/* The mbuf is consumed by the procedure. */
txom = NULL;
if (proc->write_long.attr.offset > OS_MBUF_PKTLEN(proc->write_long.attr.om)) {
rc = BLE_ATT_ERR_INVALID_OFFSET;
goto done;
}
ble_gattc_log_write_long(proc);
rc = ble_gattc_write_long_tx(proc);