summaryrefslogtreecommitdiff
path: root/mesh/node.c
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2020-05-22 11:40:40 -0700
committerBrian Gix <brian.gix@intel.com>2020-05-22 13:54:39 -0700
commit29d737730a891f7f249c76f13fa0f3e8e09ae7e2 (patch)
tree519482bd42260e09aab1746c919c0359d9661bb8 /mesh/node.c
parentebed46f05ec6a42149d6954d064d27323a0d81f2 (diff)
downloadbluez-29d737730a891f7f249c76f13fa0f3e8e09ae7e2.tar.gz
mesh: Fix using uninitialized bytes
Fixes two problems found with static analysis
Diffstat (limited to 'mesh/node.c')
-rw-r--r--mesh/node.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesh/node.c b/mesh/node.c
index dd28dfd77..49ba7c885 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -1596,6 +1596,8 @@ static void get_managed_objects_cb(struct l_dbus_message *msg, void *user_data)
/* Generate device and primary network keys */
l_getrandom(dev_key, sizeof(dev_key));
l_getrandom(net_key.old_key, sizeof(net_key.old_key));
+ memcpy(net_key.new_key, net_key.old_key,
+ sizeof(net_key.old_key));
net_key.net_idx = PRIMARY_NET_IDX;
net_key.phase = KEY_REFRESH_PHASE_NONE;