mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-14 05:57:55 +00:00
nimble/mesh: Check buffer space before relaying proxy message
Check if there is enough space left in message buffer before appending. This prevents passing broken messages to higher layer.
This commit is contained in:
@@ -71,6 +71,11 @@ int bt_mesh_proxy_msg_recv(struct bt_mesh_proxy_role *role,
|
||||
{
|
||||
const uint8_t *data = buf;
|
||||
|
||||
if (net_buf_simple_tailroom(role->buf) < len - 1) {
|
||||
BT_WARN("Proxy role buffer overflow");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (PDU_SAR(data)) {
|
||||
case SAR_COMPLETE:
|
||||
if (role->buf->om_len) {
|
||||
|
||||
Reference in New Issue
Block a user