[PATCH BlueZ 1/1] mesh: Fix segmentation fault after adding second netkey via NET_KEY_ADD opcode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Segmentation fault was caused by passing subnet pointer to the
start_network_beacon() which was NULL
---
 mesh/net.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mesh/net.c b/mesh/net.c
index c7aff9ab4..87a861bf0 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -1017,6 +1017,8 @@ int mesh_net_add_key(struct mesh_net *net, uint16_t idx, const uint8_t *value)
 			return MESH_STATUS_SUCCESS;
 		else
 			return MESH_STATUS_IDX_ALREADY_STORED;
+	} else {
+		subnet = subnet_new(net, idx);
 	}
 
 	status = add_key(net, idx, value);
@@ -2490,7 +2492,7 @@ static void net_rx(void *net_ptr, void *user_data)
 	int8_t rssi = 0;
 
 	key_id = net_key_decrypt(net->iv_index, data->data, data->len,
-								&out, &out_size);
+			&out, &out_size);
 
 	if (!key_id)
 		return;
-- 
2.20.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux