DragonFlyBSD Kernel Audit
DF-0545 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/netgraph7/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph7/bluetooth/hci/ng_hci_evnt.c
--- a/sys/netgraph7/bluetooth/hci/ng_hci_evnt.c
+++ b/sys/netgraph7/bluetooth/hci/ng_hci_evnt.c
@@ -902,6 +902,8 @@
 		/* Check if we have this connection handle */
 		con = ng_hci_con_by_handle(unit, h);
 		if (con != NULL) {
+			if (p > con->pending)
+				p = con->pending;
 			con->pending -= p;
 			if (con->pending < 0) {
 				NG_HCI_WARN(