summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2008-06-21 11:16:36 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2008-06-21 11:16:36 +0000
commit9a2d4fe9a7650097e5ef27366efbf3a14326f5b5 (patch)
tree12b13653aa662176851865f9e5acbe71c8c4b317 /IntelFrameworkModulePkg
parentacbbe34e7be0619b4fee30db8b019e2263fed598 (diff)
downloadedk2-platforms-9a2d4fe9a7650097e5ef27366efbf3a14326f5b5.tar.xz
Add parameter checking for PCI IO protocol according to UEFI spec.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5359 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciIo.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciIo.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciIo.c
index ccec7d7244..eabbe4989b 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciIo.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciIo.c
@@ -1,7 +1,7 @@
/**@file
Implement all interfaces for EFI_PCI_IO_PROTOCOL.
-Copyright (c) 2006, Intel Corporation
+Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -379,6 +379,10 @@ PciIoMemRead (
return EFI_INVALID_PARAMETER;
}
+ if (Buffer == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, Count, &Offset);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
@@ -439,6 +443,10 @@ PciIoMemWrite (
return EFI_INVALID_PARAMETER;
}
+ if (Buffer == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeMem, Width, Count, &Offset);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
@@ -499,6 +507,10 @@ PciIoIoRead (
return EFI_INVALID_PARAMETER;
}
+ if (Buffer == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, Count, &Offset);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
@@ -559,6 +571,10 @@ PciIoIoWrite (
return EFI_INVALID_PARAMETER;
}
+ if (Buffer == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
Status = PciIoVerifyBarAccess (PciIoDevice, BarIndex, PciBarTypeIo, Width, Count, &Offset);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;