public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "Zhang, Shenglei" <shenglei.zhang@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH] MdeModulePkg/Variable/Pei: Update the condition in if statement
Date: Wed, 30 Oct 2019 06:51:14 +0000	[thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A093C9556F7@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20191017031935.19796-1-shenglei.zhang@intel.com>

> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Thursday, October 17, 2019 11:20 AM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A; Gao, Liming
> Subject: [PATCH] MdeModulePkg/Variable/Pei: Update the condition in if
> statement
> 
> IndexTable->Length is used as index in array IndexTable->Index[].
> So IndexTable->Length needs to be checked, which should be less than
> the array size.
> 
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  MdeModulePkg/Universal/Variable/Pei/Variable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c
> b/MdeModulePkg/Universal/Variable/Pei/Variable.c
> index 715802f33c29..f61465fc3045 100644
> --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c
> +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c
> @@ -896,7 +896,7 @@ FindVariableEx (
>        //
>        if ((IndexTable != NULL) && !StopRecord) {
>          Offset = (UINTN) Variable - (UINTN) LastVariable;
> -        if ((Offset > 0x0FFFF) || (IndexTable->Length == sizeof (IndexTable->Index)
> / sizeof (IndexTable->Index[0]))) {
> +        if ((Offset > 0x0FFFF) || (IndexTable->Length >= sizeof (IndexTable-
> >Index) / sizeof (IndexTable->Index[0]))) {


Reviewed-by: Hao A Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


>            //
>            // Stop to record if the distance of two neighbouring VAR_ADDED
> variable is larger than the allowable scope(UINT16),
>            // or the record buffer is full.
> --
> 2.18.0.windows.1


      reply	other threads:[~2019-10-30  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17  3:19 [PATCH] MdeModulePkg/Variable/Pei: Update the condition in if statement Zhang, Shenglei
2019-10-30  6:51 ` 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=B80AF82E9BFB8E4FBD8C89DA810C6A093C9556F7@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