Fix Device_SaveCurrentSettings: do not reference BarArray too soon if the index is out of bounds (in that case it means we are handling a ROM "BAR").
CID 716153, reported by Victor Martinez Calvo.
CORE-11215 #resolve

svn path=/trunk/; revision=72050
This commit is contained in:
Hermès Bélusca-Maïto 2016-07-29 13:44:37 +00:00
parent d35cbe1643
commit 155818fc70

View file

@ -46,12 +46,12 @@ Device_SaveCurrentSettings(IN PPCI_CONFIGURATOR_CONTEXT Context)
CmDescriptor->u.Generic.Start.HighPart = 0;
CmDescriptor->u.Generic.Length = IoDescriptor->u.Generic.Length;
/* Read the actual BAR value */
Bar = BarArray[i];
/* Check which BAR is being processed now */
if (i != PCI_TYPE0_ADDRESSES)
/* Check if we're handling PCI BARs, or the ROM BAR */
if (i < PCI_TYPE0_ADDRESSES)
{
/* Read the actual BAR value */
Bar = BarArray[i];
/* Check if this is an I/O BAR */
if (Bar & PCI_ADDRESS_IO_SPACE)
{