summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-13 06:39:44 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-13 06:39:44 +0000
commit7174e04c2b4e399cc4f27547453c953d7c3ceba9 (patch)
tree1a75560dbebca68133c2947c7e1e90ea139da58e
parent8f0dd97eab98969bb26825852cb498f22daa4efd (diff)
downloadedk2-platforms-7174e04c2b4e399cc4f27547453c953d7c3ceba9.tar.xz
1.enhanced security check.
2.remove un-necessary ASSERT. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7522 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrForm.c2
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Service.c6
-rw-r--r--MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c2
3 files changed, 4 insertions, 6 deletions
diff --git a/MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrForm.c b/MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrForm.c
index 3feaf92958..9e6d3382f7 100644
--- a/MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrForm.c
+++ b/MdeModulePkg/Library/UefiIfrSupportLib/UefiIfrForm.c
@@ -1009,7 +1009,7 @@ ConstructConfigHdr (
// | 5 | 32 | 6 | NameStrLen*4 | 6 | DevicePathStrLen | 1 |
//
BufferSize = (5 + 32 + 6 + NameStrLen * 4 + 6 + DevicePathSize * 2 + 1) * sizeof (CHAR16);
- if (*StrBufferLen < BufferSize) {
+ if ((*StrBufferLen == 0) || *StrBufferLen < BufferSize) {
*StrBufferLen = BufferSize;
return EFI_BUFFER_TOO_SMALL;
}
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c
index 977db39d42..9ef83ef658 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
@@ -762,7 +762,7 @@ SetWorker (
PcdDb = IsPeiDb ? ((UINT8 *) &mPcdDatabase->PeiDb) : ((UINT8 *) &mPcdDatabase->DxeDb);
StringTable = (UINT16 *) (IsPeiDb ? &mPcdDatabase->PeiDb.Init.StringTable[0] :
- &mPcdDatabase->DxeDb.Init.StringTable[0]);
+ &mPcdDatabase->DxeDb.Init.StringTable[0]);
InternalData = PcdDb + Offset;
@@ -789,8 +789,8 @@ SetWorker (
}
}
- GuidTable = IsPeiDb ? mPcdDatabase->PeiDb.Init.GuidTable :
- mPcdDatabase->DxeDb.Init.GuidTable;
+ GuidTable = (EFI_GUID *) (IsPeiDb ? &mPcdDatabase->PeiDb.Init.GuidTable[0] :
+ &mPcdDatabase->DxeDb.Init.GuidTable[0]);
VariableHead = (VARIABLE_HEAD *) (PcdDb + Offset);
diff --git a/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c b/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c
index 86c1891668..b7f790c937 100644
--- a/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c
+++ b/MdeModulePkg/Universal/PlatformDriverOverride/PlatOverMngr/PlatOverMngr.c
@@ -928,7 +928,6 @@ UpdatePrioritySelectPage (
// Check the driver DriverImage's order number in mapping database
//
DriverImageNO = 0;
- ASSERT (mSelectedCtrIndex < MAX_CHOICE_NUM);
CheckMapping (
mControllerDevicePathProtocol[mSelectedCtrIndex],
LoadedImageDevicePath,
@@ -1029,7 +1028,6 @@ CommintChanges (
// Following code will be run if user select 'commint changes' in third page
// user enter 'Commit Changes' to save the mapping database
//
- ASSERT (mSelectedCtrIndex < MAX_CHOICE_NUM);
DeleteDriverImage (mControllerDevicePathProtocol[mSelectedCtrIndex], NULL, &mMappingDataBase);
for (SelectedDriverImageNum = 0; SelectedDriverImageNum < mSelectedDriverImageNum; SelectedDriverImageNum++) {
//