public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zeng, Star" <star.zeng@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>, "Zeng, Star" <star.zeng@intel.com>
Subject: Re: [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex"
Date: Tue, 9 Jan 2018 07:33:21 +0000	[thread overview]
Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9F954E@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1515482684-17372-1-git-send-email-dandan.bi@intel.com>

Reviewed-by: Star Zeng <star.zeng@intel.com>

Thanks,
Star
-----Original Message-----
From: Bi, Dandan 
Sent: Tuesday, January 9, 2018 3:25 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex"

In some case the ArrayIndex with UINT16 may be not large enough to hold the multiplication result of HiiQuestion->VarOffset * 8; So this patch update the data type to fix this potential issue.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
 MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c
index 0db1383..debabb5 100644
--- a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c
+++ b/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c
@@ -1,9 +1,9 @@
 /** @file
   Var Check Hii bin generation.
 
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials  are licensed and made available under the terms and conditions of the BSD License  which accompanies this distribution.  The full text of the license may be found at  http://opensource.org/licenses/bsd-license.php
 
@@ -513,11 +513,11 @@ MergeHiiQuestion (
   UINT64                            Maximum2;
   UINT64                            OneValue2;
   UINT8                             *Ptr;
   UINT8                             *Ptr1;
   UINT8                             *Ptr2;
-  UINT16                            ArrayIndex;
+  UINTN                             ArrayIndex;
 
   //
   // Hii Question from Hii Database has high priority.
   // Do not to merge Hii Question from Fv to Hii Question from Hii Database.
   //
@@ -1062,11 +1062,11 @@ ParseHiiQuestion (
   IN BOOLEAN                        FromFv,
   IN BOOLEAN                        StoredInBitField
   )
 {
   VAR_CHECK_HII_QUESTION_HEADER *HiiQuestion;
-  UINT16                        ArrayIndex;
+  UINTN                         ArrayIndex;
 
   //
   // Currently only OneOf, CheckBox and Numeric can be stored in bit field.
   //
   switch (IfrOpCodeHeader->OpCode) {
--
1.9.5.msysgit.1



      reply	other threads:[~2018-01-09  7:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09  7:24 [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex" Dandan Bi
2018-01-09  7:33 ` Zeng, Star [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=0C09AFA07DD0434D9E2A0C6AEB0483103B9F954E@shsmsx102.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