diff options
Diffstat (limited to 'MdePkg/Library/BasePciExpressLib/PciLib.c')
-rw-r--r-- | MdePkg/Library/BasePciExpressLib/PciLib.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/MdePkg/Library/BasePciExpressLib/PciLib.c b/MdePkg/Library/BasePciExpressLib/PciLib.c index 3003613486..de33bf3055 100644 --- a/MdePkg/Library/BasePciExpressLib/PciLib.c +++ b/MdePkg/Library/BasePciExpressLib/PciLib.c @@ -1195,6 +1195,11 @@ PciExpressReadBuffer ( {
UINTN EndAddress;
+ ASSERT_INVALID_PCI_ADDRESS (StartAddress);
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
+ ASSERT ((StartAddress + Size - 1) <= 0x0FFFFFFF);
+ ASSERT (Buffer != NULL);
+
EndAddress = StartAddress + Size;
if (StartAddress < EndAddress && (StartAddress & 1)) {
@@ -1278,6 +1283,11 @@ PciExpressWriteBuffer ( {
UINTN EndAddress;
+ ASSERT_INVALID_PCI_ADDRESS (StartAddress);
+ ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
+ ASSERT ((StartAddress + Size - 1) <= 0x0FFFFFFF);
+ ASSERT (Buffer != NULL);
+
EndAddress = StartAddress + Size;
if ((StartAddress < EndAddress) && ((StartAddress & 1)!= 0)) {
|