Sophie

Sophie

distrib > Mageia > 6 > i586 > by-pkgid > 397864fa8aa7091c7ab85c7accb6e9df > files > 11

bluez-5.45-2.2.mga6.src.rpm

From 01146fff6e66742b5e256cf7cbae3e0d7f30c530 Mon Sep 17 00:00:00 2001
From: "Cho, Yu-Chen" <acho@suse.com>
Date: Wed, 31 Oct 2018 16:15:07 +0800
Subject: [PATCH] hcidump:fixed hci frame dump stack-buffer-overflow

hci_dump() didn't check the length of frame, and it would be
a stack-buffer-overflow error.
---
 tools/parser/hci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/parser/hci.c b/tools/parser/hci.c
index 8c7bd2581..4e6c36040 100644
--- a/tools/parser/hci.c
+++ b/tools/parser/hci.c
@@ -4107,6 +4107,9 @@ void hci_dump(int level, struct frame *frm)
 
 	frm->ptr++; frm->len--;
 
+	if (frm->len == 0)
+		return;
+
 	switch (type) {
 	case HCI_COMMAND_PKT:
 		command_dump(level, frm);
-- 
2.19.1