]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
Add assertion to make sure the pointer is not NULL.
[mirror_edk2.git] / 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