summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/UserInterface/SetupBrowser
diff options
context:
space:
mode:
authorxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-11 08:03:27 +0000
committerxli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524>2007-01-11 08:03:27 +0000
commit41a907e423eaa4eec32b924c89474e1285abd012 (patch)
tree5c98fdcbb2adf4f3ef45450afdb77f109992e736 /EdkModulePkg/Universal/UserInterface/SetupBrowser
parentb12dbde369a174c6e73c7bc1aeb7518aea64c4a7 (diff)
downloadedk2-41a907e423eaa4eec32b924c89474e1285abd012.zip
edk2-41a907e423eaa4eec32b924c89474e1285abd012.tar.gz
edk2-41a907e423eaa4eec32b924c89474e1285abd012.tar.bz2
Add checking for memory allocation in UI modules.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2219 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/UserInterface/SetupBrowser')
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c1
-rw-r--r--EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
index d84fcf0..466039f 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/InputHandler.c
@@ -1233,6 +1233,7 @@ GetSelectionInputPopUp (
//
if (StrLen (StringPtr) > (PopUpWidth - 1)) {
TempStringPtr = AllocateZeroPool (sizeof (CHAR16) * (PopUpWidth - 1));
+ ASSERT (TempStringPtr != NULL);
CopyMem (TempStringPtr, StringPtr, (sizeof (CHAR16) * (PopUpWidth - 5)));
gBS->FreePool (StringPtr);
StringPtr = TempStringPtr;
diff --git a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
index 7a2ec04..369d2b4 100644
--- a/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
+++ b/EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Ui.c
@@ -3003,7 +3003,10 @@ Returns:
FileFormTags->VariableDefinitions->VariableFakeSize = (UINT16) (FileFormTags->VariableDefinitions->VariableFakeSize + FileFormTags->VariableDefinitions->VariableSize);
FileFormTags->VariableDefinitions->NvRamMap = AllocateZeroPool (FileFormTags->VariableDefinitions->VariableSize);
+ ASSERT (FileFormTags->VariableDefinitions->NvRamMap != NULL);
+
FileFormTags->VariableDefinitions->FakeNvRamMap = AllocateZeroPool (NvMapSize + FileFormTags->VariableDefinitions->VariableFakeSize);
+ ASSERT (FileFormTags->VariableDefinitions->FakeNvRamMap != NULL);
CopyMem (FileFormTags->VariableDefinitions->NvRamMap, NvMap, NvMapSize);
gBS->FreePool (NvMapListHead);