mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-29 04:07:23 +00:00
mesh: cfg_cli: Fix trying to write a NULL pointer
It's not always guaranteed that param->status will be non-NULL, especially not after a subsequent patch to fix a race condition with the response waiting.
This commit is contained in:
@@ -313,7 +313,9 @@ static void mod_pub_status(struct bt_mesh_model *model,
|
||||
return;
|
||||
}
|
||||
|
||||
*param->status = status;
|
||||
if (param->status) {
|
||||
*param->status = status;
|
||||
}
|
||||
|
||||
if (param->pub) {
|
||||
param->pub->addr = net_buf_simple_pull_le16(buf);
|
||||
@@ -378,7 +380,9 @@ static void mod_sub_status(struct bt_mesh_model *model,
|
||||
*param->sub_addr = sub_addr;
|
||||
}
|
||||
|
||||
*param->status = status;
|
||||
if (param->status) {
|
||||
*param->status = status;
|
||||
}
|
||||
|
||||
k_sem_give(&cli->op_sync);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user