git: 05c0c99ea37f - main - ng_hci: handle NG_HCI_M_PULLUP failure in le_advertizing_report

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Tue, 01 Nov 2022 18:38:50 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=05c0c99ea37f2558155f346769a00b4180cb59ed

commit 05c0c99ea37f2558155f346769a00b4180cb59ed
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-11-01 13:55:22 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2022-11-01 18:33:37 +0000

    ng_hci: handle NG_HCI_M_PULLUP failure in le_advertizing_report
    
    PR:             267396
    Reported by:    Robert Morris <rtm@lcs.mit.edu>
    Reviewed by:    takawata
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D37228
---
 sys/netgraph/bluetooth/hci/ng_hci_evnt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c
index b2cdf01423a2..fec039d1f1f6 100644
--- a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c
+++ b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c
@@ -399,6 +399,10 @@ le_advertizing_report(ng_hci_unit_p unit, struct mbuf *event)
 
 		/* Get remote unit address */
 		NG_HCI_M_PULLUP(event, sizeof(u_int8_t));
+		if (event == NULL) {
+			error = ENOBUFS;
+			goto out;
+		}
 		addr_type = *mtod(event, u_int8_t *);
 		m_adj(event, sizeof(u_int8_t));