]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/SetupBrowserDxe: ASSERT GetBufferForValue(&Value)
authorShenglei Zhang <shenglei.zhang@intel.com>
Tue, 15 Oct 2019 03:36:34 +0000 (11:36 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 6 Nov 2019 05:26:21 +0000 (13:26 +0800)
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>
MdeModulePkg/Universal/SetupBrowserDxe/Expression.c

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