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.
@@ -313,7 +313,9 @@ static void mod_pub_status(struct bt_mesh_model *model,
return;
}
+ 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;
}
+ if (param->status) {
*param->status = status;
+ }
k_sem_give(&cli->op_sync);
}
