diff options
author | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-10-23 06:42:32 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-10-23 06:42:32 +0000 |
commit | 5077d4e5df092cbc254aa344d6cc5f2b5722967d (patch) | |
tree | 54624746e52ca2e567c1d0622f3f41d7ab96f04c /IntelFrameworkModulePkg | |
parent | d5c5ad419e0312b95e80eacf8f726cb21b5a56a2 (diff) | |
download | edk2-platforms-5077d4e5df092cbc254aa344d6cc5f2b5722967d.tar.xz |
Add assertion to make sure the pointer is not NULL.
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
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c index dcb547a1a8..1a3ec1ff84 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c @@ -470,11 +470,13 @@ HotkeyGetOptionNumbers ( NameSize = sizeof (CHAR16);
Name = AllocateZeroPool (NameSize);
+ ASSERT (Name != NULL);
while (TRUE) {
NewNameSize = NameSize;
Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);
if (Status == EFI_BUFFER_TOO_SMALL) {
Name = ReallocatePool (NameSize, NewNameSize, Name);
+ ASSERT (Name != NULL);
Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);
NameSize = NewNameSize;
}
@@ -490,6 +492,7 @@ HotkeyGetOptionNumbers ( (*Count + 1) * sizeof (UINT16),
OptionNumbers
);
+ ASSERT (OptionNumbers != NULL);
for (Index = 0; Index < *Count; Index++) {
if (OptionNumber < OptionNumbers[Index]) {
break;
|