Author: hbelusca Date: Fri Jul 29 13:44:37 2016 New Revision: 72050
URL: http://svn.reactos.org/svn/reactos?rev=72050&view=rev Log: [PCIX] 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
Modified: trunk/reactos/drivers/bus/pcix/device.c
Modified: trunk/reactos/drivers/bus/pcix/device.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/device.c?r... ============================================================================== --- trunk/reactos/drivers/bus/pcix/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/device.c [iso-8859-1] Fri Jul 29 13:44:37 2016 @@ -46,12 +46,12 @@ 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) {