diff mbox series

[BlueZ,1/1] hcidump:fix array boundary issue le_meta_ev_dump()

Message ID 20230112232112.212021-2-jqian@calamp.com (mailing list archive)
State New, archived
Headers show
Series *** hcidump: fix array boundary issue le_meta_ev_dump *** | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Jing Qian Jan. 12, 2023, 11:21 p.m. UTC
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(-)

Comments

bluez.test.bot@gmail.com Jan. 13, 2023, 12:30 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=711516

---Test result---

Test Summary:
CheckPatch                    PASS      0.57 seconds
GitLint                       PASS      0.28 seconds
BuildEll                      PASS      26.78 seconds
BluezMake                     PASS      760.11 seconds
MakeCheck                     PASS      11.57 seconds
MakeDistcheck                 PASS      148.88 seconds
CheckValgrind                 PASS      239.87 seconds
CheckSmatch                   PASS      320.10 seconds
bluezmakeextell               PASS      96.40 seconds
IncrementalBuild              PASS      610.04 seconds
ScanBuild                     PASS      954.08 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

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: