From: "Dandan Bi" <dandan.bi@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Zhang, Shenglei" <shenglei.zhang@intel.com>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>, "Wu, Hao A" <hao.a.wu@intel.com>
Subject: Re: [edk2-devel] [PATCH v3 4/4] MdeModulePkg/SetupBrowserDxe: ASSERT GetBufferForValue(&Value)
Date: Tue, 5 Nov 2019 02:24:25 +0000 [thread overview]
Message-ID: <3C0D5C461C9E904E8F62152F6274C0BB40C95CAC@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20191101061417.28896-5-shenglei.zhang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Thanks,
Dandan
> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Zhang, Shenglei
> Sent: Friday, November 1, 2019 2:14 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>
> Subject: [edk2-devel] [PATCH v3 4/4] 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>
> ---
>
> v3: Add ASSERT instead of using error handling.
>
> MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
> b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
> index 7f4929c2fcd9..138912e00823 100644
> --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
> +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
> @@ -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);
> }
> --
> 2.18.0.windows.1
>
>
>
prev parent reply other threads:[~2019-11-05 2:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-01 6:14 [PATCH v 3 0/4] MdeModulePkg: Add check and ASSERT for variables Zhang, Shenglei
2019-11-01 6:14 ` [PATCH v3 1/4] MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry Zhang, Shenglei
2019-11-01 6:14 ` [PATCH v3 2/4] MdeModulePkg/HiiDatabaseDxe: ASSERT StringPtr Zhang, Shenglei
2019-11-01 6:14 ` [PATCH v3 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository Zhang, Shenglei
2019-11-01 6:14 ` [PATCH v3 4/4] MdeModulePkg/SetupBrowserDxe: ASSERT GetBufferForValue(&Value) Zhang, Shenglei
2019-11-05 2:24 ` Dandan Bi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C0D5C461C9E904E8F62152F6274C0BB40C95CAC@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox