Thread (2 messages) flat view 2 messages, 2 authors, 2021-03-24
STALE2007d

[PATCH BlueZ] mesh: Fix segmented msg RX with friendship

From: Brian Gix <hidden>
Date: 2021-03-24 19:35:23
Subsystem: the rest · Maintainer: Linus Torvalds

This fixes an uninitialized memory issue where a message received for
a local node is silently discarded if an uninitialized boolean is
mistakenly set to TRUE, when friendships exist.
---
 mesh/net.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/mesh/net.c b/mesh/net.c
index 6acd9bc7b..aa220f762 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -1165,6 +1165,7 @@ static struct mesh_friend_msg *mesh_friend_msg_new(uint8_t seg_max)
 
 		size += (seg_max + 1) * sizeof(struct mesh_friend_seg_12);
 		frnd_msg = l_malloc(size);
+		memset(frnd_msg, 0, size);
 	} else
 		frnd_msg = l_new(struct mesh_friend_msg, 1);
 
-- 
2.25.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help