mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-18 23:19:54 +00:00
mesh: Fix possible NULL dereferences in client models
There's a small but real chance of a race-condition when sending messages to the local node (through the local network interface) that expected parameters will be NULL in the message handles. Add appropriate NULL checks for them.
This commit is contained in:
@@ -163,7 +163,9 @@ static void net_key_status(struct bt_mesh_model *model,
|
||||
return;
|
||||
}
|
||||
|
||||
*param->status = status;
|
||||
if (param->status) {
|
||||
*param->status = status;
|
||||
}
|
||||
|
||||
k_sem_give(&cli->op_sync);
|
||||
}
|
||||
@@ -200,7 +202,9 @@ static void app_key_status(struct bt_mesh_model *model,
|
||||
return;
|
||||
}
|
||||
|
||||
*param->status = status;
|
||||
if (param->status) {
|
||||
*param->status = status;
|
||||
}
|
||||
|
||||
k_sem_give(&cli->op_sync);
|
||||
}
|
||||
@@ -250,7 +254,9 @@ static void mod_app_status(struct bt_mesh_model *model,
|
||||
return;
|
||||
}
|
||||
|
||||
*param->status = status;
|
||||
if (param->status) {
|
||||
*param->status = status;
|
||||
}
|
||||
|
||||
k_sem_give(&cli->op_sync);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,9 @@ static void health_attention_status(struct bt_mesh_model *model,
|
||||
|
||||
param = health_cli->op_param;
|
||||
|
||||
*param->attention = net_buf_simple_pull_u8(buf);
|
||||
if (param->attention) {
|
||||
*param->attention = net_buf_simple_pull_u8(buf);
|
||||
}
|
||||
|
||||
k_sem_give(&health_cli->op_sync);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user