From c3a4b94f6f34e2be00ee8f4dacd42f58015a91a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Mon, 11 Oct 2021 16:22:25 +0200 Subject: [PATCH] host/mesh: comp pointer check comp data pointer check before using This is port of d466a807ee20670e90169eb2ad36996210277893 --- nimble/host/mesh/src/access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nimble/host/mesh/src/access.c b/nimble/host/mesh/src/access.c index 85717aa51..79f4be7b4 100644 --- a/nimble/host/mesh/src/access.c +++ b/nimble/host/mesh/src/access.c @@ -328,7 +328,7 @@ int bt_mesh_comp_register(const struct bt_mesh_comp *comp) int err; /* There must be at least one element */ - if (!comp->elem_count) { + if (!comp || !comp->elem_count) { return -EINVAL; }