Skip to content

Commit

Permalink
MdeModulePkg/SetupBrowserDxe: ASSERT GetBufferForValue(&Value)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
shenglei10 authored and lgao4 committed Nov 6, 2019
1 parent 3fb7e09 commit 0c1541d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0c1541d

Please sign in to comment.