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.115; helo=mga14.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 38DBC2035D311 for ; Mon, 8 Jan 2018 23:19:46 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jan 2018 23:24:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,334,1511856000"; d="scan'208";a="193473234" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga006.fm.intel.com with ESMTP; 08 Jan 2018 23:24:56 -0800 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Star Zeng , Liming Gao Date: Tue, 9 Jan 2018 15:24:44 +0800 Message-Id: <1515482684-17372-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [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:19:47 -0000 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/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.
+Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
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