diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-09-25 07:53:34 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-09-25 07:53:34 +0000 |
commit | eb14b4813098615d2d2cfc843117ee86d9d6aeab (patch) | |
tree | a321bd383adf5869ffc88cdc7fbe1591051b874f /IntelFrameworkModulePkg/Bus | |
parent | e8de46808a7d2426116de79cdf2aeab43d5a5537 (diff) | |
download | edk2-platforms-eb14b4813098615d2d2cfc843117ee86d9d6aeab.tar.xz |
add security check
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9311 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Bus')
-rw-r--r-- | IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 2 | ||||
-rw-r--r-- | IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index 5aba4315ce..8f3ed5eb37 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -374,6 +374,8 @@ GatherDeviceInfo ( for (Offset = PciIoDevice->SrIovCapabilityOffset + EFI_PCIE_CAPABILITY_ID_SRIOV_BAR0, BarIndex = 0;
Offset <= PciIoDevice->SrIovCapabilityOffset + EFI_PCIE_CAPABILITY_ID_SRIOV_BAR5;
BarIndex++) {
+
+ ASSERT (BarIndex < PCI_MAX_BAR);
Offset = PciIovParseVfBar (PciIoDevice, Offset, BarIndex);
}
}
diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c index 17c864029b..4fea030687 100644 --- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c +++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c @@ -1229,6 +1229,8 @@ ProgramBar ( UINT64 Address;
UINT32 Address32;
+ ASSERT (Node->Bar < PCI_MAX_BAR);
+
//
// Check VF BAR
//
@@ -1249,7 +1251,6 @@ ProgramBar ( //
Node->PciDev->Allocated = TRUE;
- ASSERT (Node->Bar < PCI_MAX_BAR);
switch ((Node->PciDev->PciBar[Node->Bar]).BarType) {
case PciBarTypeIo16:
|