ble_mesh: stack: Add proxy cfg pdu length check

pull/5688/head
lly 2020-07-06 20:46:14 +08:00 zatwierdzone przez bot
rodzic aeb44745bf
commit 82d4bd280b
2 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -154,6 +154,11 @@ static void proxy_cfg(struct bt_mesh_proxy_server *server)
u8_t opcode = 0U;
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,
&rx, &buf);
if (err) {

Wyświetl plik

@ -292,6 +292,11 @@ static void proxy_cfg(struct bt_mesh_proxy_client *client)
u8_t opcode = 0U;
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,
&rx, &buf);
if (err) {