1. When get value from AltCfg data, check the varstore type first.
2. Check the pointer's validation before using it. Signed-off-by:ydong10 Reviewed-by:lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11816 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -457,6 +457,7 @@ InitializeRequestElement (
|
|||||||
|
|
||||||
if (!Find) {
|
if (!Find) {
|
||||||
ConfigInfo = AllocateZeroPool(sizeof (FORM_BROWSER_CONFIG_REQUEST));
|
ConfigInfo = AllocateZeroPool(sizeof (FORM_BROWSER_CONFIG_REQUEST));
|
||||||
|
ASSERT (ConfigInfo != NULL);
|
||||||
ConfigInfo->Signature = FORM_BROWSER_CONFIG_REQUEST_SIGNATURE;
|
ConfigInfo->Signature = FORM_BROWSER_CONFIG_REQUEST_SIGNATURE;
|
||||||
ConfigInfo->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigHdr), Storage->ConfigHdr);
|
ConfigInfo->ConfigRequest = AllocateCopyPool (StrSize (Storage->ConfigHdr), Storage->ConfigHdr);
|
||||||
ConfigInfo->SpareStrLen = 0;
|
ConfigInfo->SpareStrLen = 0;
|
||||||
|
@@ -1023,7 +1023,9 @@ FindNextMenu (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Selection->Statement = NULL;
|
Selection->Statement = NULL;
|
||||||
CurrentMenu->QuestionId = 0;
|
if (CurrentMenu != NULL) {
|
||||||
|
CurrentMenu->QuestionId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
Selection->Action = UI_ACTION_EXIT;
|
Selection->Action = UI_ACTION_EXIT;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -2133,6 +2133,7 @@ GetDefaultValueFromAltCfg (
|
|||||||
ConfigRequest = NULL;
|
ConfigRequest = NULL;
|
||||||
Result = NULL;
|
Result = NULL;
|
||||||
ConfigResp = NULL;
|
ConfigResp = NULL;
|
||||||
|
Value = NULL;
|
||||||
Storage = Question->Storage;
|
Storage = Question->Storage;
|
||||||
|
|
||||||
if ((Storage == NULL) || (Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE)) {
|
if ((Storage == NULL) || (Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE)) {
|
||||||
@@ -2213,12 +2214,18 @@ GetDefaultValueFromAltCfg (
|
|||||||
//
|
//
|
||||||
// Skip <ConfigRequest>
|
// Skip <ConfigRequest>
|
||||||
//
|
//
|
||||||
Value = StrStr (ConfigResp, L"&VALUE");
|
|
||||||
if (IsBufferStorage) {
|
if (IsBufferStorage) {
|
||||||
|
Value = StrStr (ConfigResp, L"&VALUE");
|
||||||
|
ASSERT (Value != NULL);
|
||||||
//
|
//
|
||||||
// Skip "&VALUE"
|
// Skip "&VALUE"
|
||||||
//
|
//
|
||||||
Value = Value + 6;
|
Value = Value + 6;
|
||||||
|
} else {
|
||||||
|
Value = StrStr (ConfigResp, Question->VariableName);
|
||||||
|
ASSERT (Value != NULL);
|
||||||
|
|
||||||
|
Value = Value + StrLen (Question->VariableName);
|
||||||
}
|
}
|
||||||
if (*Value != '=') {
|
if (*Value != '=') {
|
||||||
Status = EFI_NOT_FOUND;
|
Status = EFI_NOT_FOUND;
|
||||||
|
Reference in New Issue
Block a user