All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/1] *** hcidump: fix array boundary issue le_meta_ev_dump ***
@ 2023-01-06  1:31 Jing Qian
  2023-01-06  1:31 ` [PATCH BlueZ 1/1] hcidump:fix array boundary issue le_meta_ev_dump() Jing Qian
  0 siblings, 1 reply; 4+ messages in thread
From: Jing Qian @ 2023-01-06  1:31 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jing Qian

*** BLURB HERE ***

Jing Qian (1):
  hcidump:fix array boundary issue le_meta_ev_dump()

 tools/parser/hci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)


base-commit: 4e2ae14ea31178ebbbcb0bc81dfe74bd56b4885f
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH BlueZ 1/1] hcidump:fix array boundary issue le_meta_ev_dump()
@ 2023-01-12 23:21 Jing Qian
  2023-01-13  0:30 ` *** hcidump: fix array boundary issue le_meta_ev_dump *** bluez.test.bot
  0 siblings, 1 reply; 4+ messages in thread
From: Jing Qian @ 2023-01-12 23:21 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jing Qian

le_meta_ev_dump() print array content without checking index boundary.
hcidump would crash if the event index is out-of-boundary
---
 tools/parser/hci.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/parser/hci.c b/tools/parser/hci.c
index db7d32c011b9..30feafaed36c 100644
--- a/tools/parser/hci.c
+++ b/tools/parser/hci.c
@@ -3657,7 +3657,11 @@ static inline void le_meta_ev_dump(int level, struct frame *frm)
 	frm->len -= EVT_LE_META_EVENT_SIZE;
 
 	p_indent(level, frm);
-	printf("%s\n", ev_le_meta_str[subevent]);
+	if (subevent <= LE_EV_NUM) {
+		printf("%s\n", ev_le_meta_str[subevent]);
+	} else {
+		printf("Undefined--> %d\n", subevent);
+	}
 
 	switch (mevt->subevent) {
 	case EVT_LE_CONN_COMPLETE:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-13  0:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-06  1:31 [PATCH BlueZ 0/1] *** hcidump: fix array boundary issue le_meta_ev_dump *** Jing Qian
2023-01-06  1:31 ` [PATCH BlueZ 1/1] hcidump:fix array boundary issue le_meta_ev_dump() Jing Qian
2023-01-06  3:22   ` *** hcidump: fix array boundary issue le_meta_ev_dump *** bluez.test.bot
  -- strict thread matches above, loose matches on Subject: below --
2023-01-12 23:21 [PATCH BlueZ 1/1] hcidump:fix array boundary issue le_meta_ev_dump() Jing Qian
2023-01-13  0:30 ` *** hcidump: fix array boundary issue le_meta_ev_dump *** bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.