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
This commit is contained in:
qwang12 2009-01-20 01:55:11 +00:00
parent 96ff65a1fb
commit d0720b5706
2 changed files with 6 additions and 3 deletions

View File

@ -703,7 +703,7 @@ IfrCatenate (
} }
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle); String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);
if (String== NULL) { if (String[Index] == NULL) {
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
goto Done; goto Done;
} }
@ -850,7 +850,7 @@ IfrFind (
} }
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle); String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);
if (String== NULL) { if (String[Index] == NULL) {
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
goto Done; goto Done;
} }
@ -1006,7 +1006,7 @@ IfrToken (
} }
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle); String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);
if (String== NULL) { if (String[Index] == NULL) {
Status = EFI_NOT_FOUND; Status = EFI_NOT_FOUND;
goto Done; goto Done;
} }

View File

@ -966,6 +966,7 @@ ParseOpCodes (
break; break;
case EFI_IFR_THIS_OP: case EFI_IFR_THIS_OP:
ASSERT (CurrentStatement != NULL);
ExpressionOpCode->QuestionId = CurrentStatement->QuestionId; ExpressionOpCode->QuestionId = CurrentStatement->QuestionId;
break; break;
@ -1058,6 +1059,7 @@ ParseOpCodes (
// //
// Evaluate DisableIf expression // Evaluate DisableIf expression
// //
ASSERT (CurrentExpression != NULL);
Status = EvaluateExpression (FormSet, CurrentForm, CurrentExpression); Status = EvaluateExpression (FormSet, CurrentForm, CurrentExpression);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
@ -1574,6 +1576,7 @@ ParseOpCodes (
break; break;
case EFI_IFR_FORM_OP: case EFI_IFR_FORM_OP:
ASSERT (CurrentForm != NULL);
ImageId = &CurrentForm->ImageId; ImageId = &CurrentForm->ImageId;
break; break;