MdeModulePkg/SetupBrowserDxe: ASSERT GetBufferForValue(&Value)

Before called by GetBufferForValue(), Value has already been called
function IsTypeInBuffer to make sure the value must be buffer type.
So GetBufferForValue can not return NULL.
This commit adds ASSERT to assume (GetBufferForValue (&Value) is not
NULL.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
This commit is contained in:
Shenglei Zhang 2019-10-15 11:36:34 +08:00 committed by Liming Gao
parent 3fb7e094ef
commit 0c1541d457
1 changed files with 3 additions and 0 deletions

View File

@ -1281,7 +1281,10 @@ IfrToUint (
Result->Type = EFI_IFR_TYPE_UNDEFINED;
return EFI_SUCCESS;
}
ASSERT (GetBufferForValue (&Value) != NULL);
Result->Value.u64 = *(UINT64*) GetBufferForValue (&Value);
if (Value.Type == EFI_IFR_TYPE_BUFFER) {
FreePool (Value.Buffer);
}