⬢ DragonFlyBSD Kernel Audit
DF-4738 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/pccard/pccbb/pccbb_pci.c	2026-09-23 05:16:43.065190791 +0000
+++ b/sys/dev/pccard/pccbb/pccbb_pci.c	2026-09-23 05:16:43.077190635 +0000
@@ -345,6 +345,11 @@
 	if (sc->secbus == 0 || sc->pribus != pribus) {
 		if (curr_bus_number <= sc->pribus)
 			curr_bus_number = sc->pribus + 1;
+		if (curr_bus_number > 254) {
+			device_printf(brdev, "out of PCI bus numbers for "
+			    "CardBus socket\n");
+			goto err;
+		}
 		if (pribus != sc->pribus) {
 			DEVPRINTF((brdev, "Setting primary bus to %d\n",
 			    sc->pribus));