summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Expression.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Expression.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
index 3766ca12..29de5034 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
@@ -1,7 +1,7 @@
/** @file
Utility functions for expression evaluation.
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -1446,7 +1446,6 @@ IfrMid (
UINTN Base;
UINTN Length;
CHAR16 *SubString;
- UINT8 *Buffer;
UINT16 BufferLen;
ZeroMem (Value, sizeof (Value));
@@ -1502,7 +1501,6 @@ IfrMid (
FreePool (String);
} else {
- Buffer = Value[2].Buffer;
BufferLen = Value[2].BufferLen;
Result->Type = EFI_IFR_TYPE_BUFFER;
@@ -1513,7 +1511,7 @@ IfrMid (
Result->BufferLen = (UINT16)((BufferLen - Base) < Length ? (BufferLen - Base) : Length);
Result->Buffer = AllocateZeroPool (Result->BufferLen);
ASSERT (Result->Buffer != NULL);
- CopyMem (Result->Buffer, &Buffer[Base], Result->BufferLen);
+ CopyMem (Result->Buffer, &Buffer[Base], Result->BufferLen);
}
FreePool (Value[2].Buffer);
@@ -2470,22 +2468,21 @@ EvaluateExpression (
}
if (OpCode->DevicePath != 0) {
- StrPtr = GetToken (OpCode->DevicePath, FormSet->HiiHandle);
- if (StrPtr == NULL) {
- Value->Type = EFI_IFR_TYPE_UNDEFINED;
- break;
- }
-
- DevicePath = ConvertDevicePathFromText(StrPtr);
+ Value->Type = EFI_IFR_TYPE_UNDEFINED;
- if (!GetQuestionValueFromForm(DevicePath, NULL, &OpCode->Guid, Value->Value.u16, &QuestionVal)){
- Value->Type = EFI_IFR_TYPE_UNDEFINED;
- } else {
- Value = &QuestionVal;
+ StrPtr = GetToken (OpCode->DevicePath, FormSet->HiiHandle);
+ if (StrPtr != NULL && mPathFromText != NULL) {
+ DevicePath = mPathFromText->ConvertTextToDevicePath(StrPtr);
+ if (DevicePath != NULL && GetQuestionValueFromForm(DevicePath, NULL, &OpCode->Guid, Value->Value.u16, &QuestionVal)) {
+ Value = &QuestionVal;
+ }
+ if (DevicePath != NULL) {
+ FreePool (DevicePath);
+ }
}
- if (DevicePath != NULL) {
- FreePool (DevicePath);
+ if (StrPtr != NULL) {
+ FreePool (StrPtr);
}
} else if (CompareGuid (&OpCode->Guid, &gZeroGuid) != 0) {
if (!GetQuestionValueFromForm(NULL, FormSet->HiiHandle, &OpCode->Guid, Value->Value.u16, &QuestionVal)){