From c8afb9bc3f2a97f6fb74c8c0b9719ba3d6439e33 Mon Sep 17 00:00:00 2001 From: Neel Natu Date: Wed, 6 Nov 2013 22:35:52 +0000 Subject: [PATCH] Fix an off-by-one error when iterating over the emulated PCI BARs. Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com) --- usr.sbin/bhyve/pci_emul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index bbaac23fed7..3820b046fd0 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -1252,7 +1252,7 @@ pci_emul_cmdwrite(struct pci_devinst *pi, uint32_t new, int bytes) * If the MMIO or I/O address space decoding has changed then * register/unregister all BARs that decode that address space. */ - for (i = 0; i < PCI_BARMAX; i++) { + for (i = 0; i <= PCI_BARMAX; i++) { switch (pi->pi_bar[i].type) { case PCIBAR_NONE: case PCIBAR_MEMHI64: