From f6f82b39d3287ae5eb4ee3ac323373265c72847f Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 9 May 2025 16:16:18 -0400 Subject: [PATCH] mesh: Fix possible null pointer deference This fixes possible null pointer deference for label reported by cppcheck. Fixes: https://github.com/bluez/bluez/security/code-scanning/1771 --- mesh/cfgmod-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c index e5d5a86e0..f9f80aff7 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -203,7 +203,7 @@ static bool save_cfg_sub(struct mesh_node *node, uint16_t ele_addr, id = (vendor) ? id : MODEL_ID(id); - if (virt) + if (virt && label) memcpy(db_sub.addr.label, label, 16); if (opcode == OP_CONFIG_MODEL_SUB_VIRT_DELETE || -- 2.47.3