From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=star.zeng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2F7BC2035D31D for ; Mon, 8 Jan 2018 23:28:14 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 23:33:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,334,1511856000"; d="scan'208";a="191757246" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 08 Jan 2018 23:33:23 -0800 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 23:33:23 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Jan 2018 23:33:23 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Tue, 9 Jan 2018 15:33:21 +0800 From: "Zeng, Star" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zeng, Star" Thread-Topic: [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex" Thread-Index: AQHTiRr3hgBbHyJyEk+5mFngJFWHFqNrJewA Date: Tue, 9 Jan 2018 07:33:21 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B9F954E@shsmsx102.ccr.corp.intel.com> References: <1515482684-17372-1-git-send-email-dandan.bi@intel.com> In-Reply-To: <1515482684-17372-1-git-send-email-dandan.bi@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] MdeModulePkg/VarCheckHii: Update data type for variable "ArrayIndex" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2018 07:28:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Star Zeng Thanks, Star -----Original Message----- From: Bi, Dandan=20 Sent: Tuesday, January 9, 2018 3:25 PM To: edk2-devel@lists.01.org Cc: Zeng, Star ; Gao, Liming Subject: [patch] MdeModulePkg/VarCheckHii: Update data type for variable "A= rrayIndex" 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 Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiGen.c b/MdeModu= lePkg/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. =20 -Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at http://opens= ource.org/licenses/bsd-license.php =20 @@ -513,11 +513,11 @@ MergeHiiQuestion ( UINT64 Maximum2; UINT64 OneValue2; UINT8 *Ptr; UINT8 *Ptr1; UINT8 *Ptr2; - UINT16 ArrayIndex; + UINTN ArrayIndex; =20 // // Hii Question from Hii Database has high priority. // Do not to merge Hii Question from Fv to Hii Question from Hii Databas= e. // @@ -1062,11 +1062,11 @@ ParseHiiQuestion ( IN BOOLEAN FromFv, IN BOOLEAN StoredInBitField ) { VAR_CHECK_HII_QUESTION_HEADER *HiiQuestion; - UINT16 ArrayIndex; + UINTN ArrayIndex; =20 // // Currently only OneOf, CheckBox and Numeric can be stored in bit field= . // switch (IfrOpCodeHeader->OpCode) { -- 1.9.5.msysgit.1