\r
Exit:\r
\r
- if (!EFI_ERROR (Status)) {\r
+ if (!EFI_ERROR (Status) && (Result != NULL)) {\r
//\r
// Copy the <ConfigHdr> and <ConfigBody>\r
//\r
}\r
\r
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);\r
- if (String== NULL) {\r
+ if (String [Index] == NULL) {\r
Status = EFI_NOT_FOUND;\r
goto Done;\r
}\r
}\r
\r
String[Index] = GetToken (Value.Value.string, FormSet->HiiHandle);\r
- if (String== NULL) {\r
+ if (String [Index] == NULL) {\r
Status = EFI_NOT_FOUND;\r
goto Done;\r
}\r
\r
\r
/**\r
- Evaluate the result of a HII expression\r
+ Evaluate the result of a HII expression.\r
+\r
+ If Expression is NULL, then ASSERT.\r
\r
@param FormSet FormSet associated with this expression.\r
@param Form Form associated with this expression.\r
//\r
ResetExpressionStack ();\r
\r
+ ASSERT (Expression != NULL);\r
Expression->Result.Type = EFI_IFR_TYPE_OTHER;\r
\r
Link = GetFirstNode (&Expression->OpCodeListHead);\r
//\r
// Evaluate DisableIf expression\r
//\r
- ASSERT (CurrentExpression != NULL);\r
Status = EvaluateExpression (FormSet, CurrentForm, CurrentExpression);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
//\r
case EFI_IFR_SUBTITLE_OP:\r
CurrentStatement = CreateStatement (OpCodeData, FormSet, CurrentForm);\r
+ ASSERT (CurrentStatement != NULL);\r
+ \r
CurrentStatement->Flags = ((EFI_IFR_SUBTITLE *) OpCodeData)->Flags;\r
\r
if (Scope != 0) {\r
\r
case EFI_IFR_TEXT_OP:\r
CurrentStatement = CreateStatement (OpCodeData, FormSet, CurrentForm);\r
+ ASSERT (CurrentStatement != NULL);\r
\r
CopyMem (&CurrentStatement->TextTwo, &((EFI_IFR_TEXT *) OpCodeData)->TextTwo, sizeof (EFI_STRING_ID));\r
break;\r
//\r
case EFI_IFR_ACTION_OP:\r
CurrentStatement = CreateQuestion (OpCodeData, FormSet, CurrentForm);\r
+ ASSERT (CurrentStatement != NULL);\r
\r
if (OpCodeLength == sizeof (EFI_IFR_ACTION_1)) {\r
//\r
//\r
// If used for a question, then the question will be read-only\r
//\r
+ //\r
+ // Make sure CurrentStatement is not NULL.\r
+ // If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR\r
+ // file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.\r
+ //\r
+ ASSERT (CurrentStatement != NULL);\r
CurrentStatement->ValueExpression = CurrentExpression;\r
}\r
break;\r
break;\r
\r
default:\r
+ //\r
+ // Make sure CurrentStatement is not NULL.\r
+ // If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR\r
+ // file is wrongly generated by tools such as VFR Compiler.\r
+ //\r
+ ASSERT (CurrentStatement != NULL);\r
ImageId = &CurrentStatement->ImageId;\r
break;\r
}\r
\r
InputText[0] = LEFT_NUMERIC_DELIMITER;\r
SetUnicodeMem (InputText + 1, InputWidth, L' ');\r
- ASSERT (InputWidth < MAX_NUMERIC_INPUT_WIDTH); \r
+ ASSERT (InputWidth + 2 < MAX_NUMERIC_INPUT_WIDTH); \r
InputText[InputWidth + 1] = RIGHT_NUMERIC_DELIMITER;\r
InputText[InputWidth + 2] = L'\0';\r
\r
}\r
\r
Count++;\r
+ ASSERT (Count < (sizeof (PreviousNumber) / sizeof (PreviousNumber[0])));\r
PreviousNumber[Count] = EditValue;\r
\r
PrintCharAt (Column, Row, Key.UnicodeChar);\r
AllocateSize += 0x10;\r
OldIndexArray = IndexArray;\r
IndexArray = AllocatePool (AllocateSize * sizeof (UINTN) * 3);\r
+ ASSERT (IndexArray != NULL);\r
+ \r
CopyMem (IndexArray, OldIndexArray, LineCount * sizeof (UINTN) * 3);\r
FreePool (OldIndexArray);\r
}\r
InterlockedDecrement (&mVariableModuleGlobal->VariableGlobal.ReentrantState);\r
ReleaseLockOnlyAtBootTime (&mVariableModuleGlobal->VariableGlobal.VariableServicesLock);\r
\r
+#if 0\r
+ if ((StrCmp (VariableName , L"Lang") == 0) && CompareGuid (VendorGuid, gEfiGlobalVariableGuid)) {\r
+ \r
+ }\r
+#endif\r
return Status;\r
}\r
\r