From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "Zhang, Shenglei" <shenglei.zhang@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>,
"Dong, Eric" <eric.dong@intel.com>,
"Bi, Dandan" <dandan.bi@intel.com>
Cc: "Wang, Jian J" <jian.j.wang@intel.com>
Subject: Re: [PATCH 4/4] MdeModulePkg/SetupBrowserDxe: Add check for GetBufferForValue()
Date: Wed, 30 Oct 2019 07:01:03 +0000 [thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A093C955729@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20191017033110.12128-5-shenglei.zhang@intel.com>
Hello Eric and Dandan,
Could you help to review this patch?
Thanks in advance.
Best Regards,
Hao Wu
> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Thursday, October 17, 2019 11:31 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A
> Subject: [PATCH 4/4] MdeModulePkg/SetupBrowserDxe: Add check for
> GetBufferForValue()
>
> The returned value from GetBufferForValue might be NULL, so add a
> check for that before it is used.
>
> 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>
> ---
> MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
> b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
> index 7f4929c2fcd9..984c68c6bb7a 100644
> --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
> +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c
> @@ -1281,7 +1281,12 @@ IfrToUint (
> Result->Type = EFI_IFR_TYPE_UNDEFINED;
> return EFI_SUCCESS;
> }
> +
> + if (GetBufferForValue (&Value) == NULL) {
> + return EFI_NOT_FOUND;
> + }
> 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-10-30 7:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-17 3:31 [PATCH 0/4] MdeModulePkg: Add check for variables and return value Zhang, Shenglei
2019-10-17 3:31 ` [PATCH 1/4] MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry Zhang, Shenglei
2019-10-30 7:00 ` Wu, Hao A
2019-10-17 3:31 ` [PATCH 2/4] MdeModulePkg/HiiDatabaseDxe: Add check for StringPtr Zhang, Shenglei
2019-10-17 8:41 ` Dandan Bi
2019-10-17 3:31 ` [PATCH 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository Zhang, Shenglei
2019-10-30 7:01 ` Wu, Hao A
2019-10-17 3:31 ` [PATCH 4/4] MdeModulePkg/SetupBrowserDxe: Add check for GetBufferForValue() Zhang, Shenglei
2019-10-30 7:01 ` Wu, Hao A [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=B80AF82E9BFB8E4FBD8C89DA810C6A093C955729@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