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:
Szymon Janc
2026-08-01 17:54:42 +05:30
committed by Rahul Tank
parent 4d607528a4
commit ddaed0064b
+5
View File
@@ -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) {