summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-20 01:55:11 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-20 01:55:11 +0000
commitd0720b57060cc8f8bd0c21cb9937bbb87b420d36 (patch)
tree7eae99ad09f2bd87e9821cae25ab1ab03852310a
parent96ff65a1fb627823efaf4dc7cd01a424fa5297e8 (diff)
downloadedk2-d0720b57060cc8f8bd0c21cb9937bbb87b420d36.zip
edk2-d0720b57060cc8f8bd0c21cb9937bbb87b420d36.tar.gz
edk2-d0720b57060cc8f8bd0c21cb9937bbb87b420d36.tar.bz2
K8:
Add in "check-for-null" to catch the de-reference of NULL pointer. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7309 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Expression.c6
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
index 5044fd1..ed77094 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
@@ -703,7 +703,7 @@ IfrCatenate (
}
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);
- if (String== NULL) {
+ if (String[Index] == NULL) {
Status = EFI_NOT_FOUND;
goto Done;
}
@@ -850,7 +850,7 @@ IfrFind (
}
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);
- if (String== NULL) {
+ if (String[Index] == NULL) {
Status = EFI_NOT_FOUND;
goto Done;
}
@@ -1006,7 +1006,7 @@ IfrToken (
}
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);
- if (String== NULL) {
+ if (String[Index] == NULL) {
Status = EFI_NOT_FOUND;
goto Done;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index 35ed197..7a09b32 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -966,6 +966,7 @@ ParseOpCodes (
break;
case EFI_IFR_THIS_OP:
+ ASSERT (CurrentStatement != NULL);
ExpressionOpCode->QuestionId = CurrentStatement->QuestionId;
break;
@@ -1058,6 +1059,7 @@ ParseOpCodes (
//
// Evaluate DisableIf expression
//
+ ASSERT (CurrentExpression != NULL);
Status = EvaluateExpression (FormSet, CurrentForm, CurrentExpression);
if (EFI_ERROR (Status)) {
return Status;
@@ -1574,6 +1576,7 @@ ParseOpCodes (
break;
case EFI_IFR_FORM_OP:
+ ASSERT (CurrentForm != NULL);
ImageId = &CurrentForm->ImageId;
break;