public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex"
@ 2018-01-09  7:24 Dandan Bi
  2018-01-09  7:33 ` Zeng, Star
  0 siblings, 1 reply; 2+ messages in thread
From: Dandan Bi @ 2018-01-09  7:24 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Liming Gao

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex"
  2018-01-09  7:24 [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex" Dandan Bi
@ 2018-01-09  7:33 ` Zeng, Star
  0 siblings, 0 replies; 2+ messages in thread
From: Zeng, Star @ 2018-01-09  7:33 UTC (permalink / raw)
  To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Gao, Liming, Zeng, Star

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-09  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-09  7:24 [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex" Dandan Bi
2018-01-09  7:33 ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox