Skip to content
Snippets Groups Projects
Commit dc2eea31 authored by Hui Peng's avatar Hui Peng Committed by Automerger Merge Worker
Browse files

Merge "Fix an OOB write bug in gatt_process_notification" into tm-dev am: 68569357

parents de28d04d 68569357
No related branches found
No related tags found
No related merge requests found
......@@ -758,6 +758,10 @@ void gatt_process_notification(tGATT_TCB& tcb, uint16_t cid, uint8_t op_code,
// Make sure we don't read past the remaining data even if the length says
// we can Also need to watch comparing the int16_t with the uint16_t
value.len = std::min((uint16_t)rem_len, value.len);
if (value.len > sizeof(value.value)) {
LOG(ERROR) << "Unexpected value.len (>GATT_MAX_ATTR_LEN), stop";
return ;
}
STREAM_TO_ARRAY(value.value, p, value.len);
// Accounting
rem_len -= value.len;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment