]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add assertion to make sure the pointer is not NULL.
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 23 Oct 2012 06:42:32 +0000 (06:42 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 23 Oct 2012 06:42:32 +0000 (06:42 +0000)
Signed-off-by: Ruiyu Ni<ruiyu.ni@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13877 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c

index dcb547a1a8077e63fd31f6e743921cb46d1eb340..1a3ec1ff844039f000213a09082225a4a68cf6f6 100644 (file)
@@ -470,11 +470,13 @@ HotkeyGetOptionNumbers (
 \r
   NameSize = sizeof (CHAR16);\r
   Name     = AllocateZeroPool (NameSize);\r
+  ASSERT (Name != NULL);\r
   while (TRUE) {\r
     NewNameSize = NameSize;\r
     Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);\r
     if (Status == EFI_BUFFER_TOO_SMALL) {\r
       Name = ReallocatePool (NameSize, NewNameSize, Name);\r
+      ASSERT (Name != NULL);\r
       Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);\r
       NameSize = NewNameSize;\r
     }\r
@@ -490,6 +492,7 @@ HotkeyGetOptionNumbers (
                         (*Count + 1) * sizeof (UINT16),\r
                         OptionNumbers\r
                         );\r
+      ASSERT (OptionNumbers != NULL);\r
       for (Index = 0; Index < *Count; Index++) {\r
         if (OptionNumber < OptionNumbers[Index]) {\r
           break;\r