ble_mesh: stack: Add proxy cfg pdu length check
This commit is contained in:
parent
55489bb41a
commit
f6cc9afaa9
|
@ -154,6 +154,11 @@ static void proxy_cfg(struct bt_mesh_proxy_server *server)
|
||||||
u8_t opcode = 0U;
|
u8_t opcode = 0U;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
|
if (server->buf.len > 29) {
|
||||||
|
BT_ERR("Too large proxy cfg pdu (len %d)", server->buf.len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
err = bt_mesh_net_decode(&server->buf, BLE_MESH_NET_IF_PROXY_CFG,
|
err = bt_mesh_net_decode(&server->buf, BLE_MESH_NET_IF_PROXY_CFG,
|
||||||
&rx, &buf);
|
&rx, &buf);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -292,6 +292,11 @@ static void proxy_cfg(struct bt_mesh_proxy_client *client)
|
||||||
u8_t opcode = 0U;
|
u8_t opcode = 0U;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
|
if (client->buf.len > 29) {
|
||||||
|
BT_ERR("Too large proxy cfg pdu (len %d)", client->buf.len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
err = bt_mesh_net_decode(&client->buf, BLE_MESH_NET_IF_PROXY_CFG,
|
err = bt_mesh_net_decode(&client->buf, BLE_MESH_NET_IF_PROXY_CFG,
|
||||||
&rx, &buf);
|
&rx, &buf);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in a new issue