diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-06 06:34:43 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-06 06:34:43 +0000 |
commit | c410589ef1d5467c6d7bbec6efdbfb541263b5d5 (patch) | |
tree | aed26bd89224cd67fc35b2914c852467bfe3a8b8 /MdeModulePkg | |
parent | fd0d484170528a47463d9d7ffd6a3b43cd4365e9 (diff) | |
download | edk2-platforms-c410589ef1d5467c6d7bbec6efdbfb541263b5d5.tar.xz |
K8: Add in ASSERT to detect possible NULL pointer dereference.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7462 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index 60992a31dd..0070502f9b 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -1,7 +1,7 @@ /** @file
Parser for IFR binary encoding.
-Copyright (c) 2007 - 2008, Intel Corporation
+Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -852,6 +852,7 @@ ParseOpCodes ( CurrentDefault = NULL;
CurrentOption = NULL;
OptionSuppressExpression = NULL;
+ ImageId = NULL;
//
// Get the number of Statements and Expressions
@@ -1063,6 +1064,8 @@ ParseOpCodes ( if (EFI_ERROR (Status)) {
return Status;
}
+
+ ASSERT (CurrentExpression != NULL);
if (CurrentExpression->Result.Type != EFI_IFR_TYPE_BOOLEAN) {
return EFI_INVALID_PARAMETER;
}
@@ -1604,6 +1607,7 @@ ParseOpCodes ( break;
}
+ ASSERT (ImageId != NULL);
CopyMem (ImageId, &((EFI_IFR_IMAGE *) OpCodeData)->Id, sizeof (EFI_IMAGE_ID));
break;
@@ -1611,6 +1615,7 @@ ParseOpCodes ( // Refresh
//
case EFI_IFR_REFRESH_OP:
+ ASSERT (CurrentStatement != NULL);
CurrentStatement->RefreshInterval = ((EFI_IFR_REFRESH *) OpCodeData)->RefreshInterval;
break;
|