Diff between 126f01f83ab2f1f81080685eeef75102f5cc8b54 and 4a219255437b1b5a63ea3e472281379ede6d793a

Changed Files

File Additions Deletions Status
mesh/appkey.c +3 -0 modified

Full Patch

diff --git a/mesh/appkey.c b/mesh/appkey.c
index f799b77..3cc1e4f 100644
--- a/mesh/appkey.c
+++ b/mesh/appkey.c
@@ -506,6 +506,9 @@ uint8_t appkey_list(struct mesh_net *net, uint16_t net_idx, uint8_t *buf,
 
 	*size = 0;
 
+	if (!mesh_net_have_key(net, net_idx))
+		return MESH_STATUS_INVALID_NETKEY;
+
 	app_keys = mesh_net_get_app_keys(net);
 	if (!app_keys || l_queue_isempty(app_keys))
 		return MESH_STATUS_SUCCESS;