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.43; helo=mga05.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 0038721162CD1 for ; Sun, 7 Oct 2018 18:29:50 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2018 18:29:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,355,1534834800"; d="scan'208";a="270326274" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by fmsmga006.fm.intel.com with ESMTP; 07 Oct 2018 18:29:30 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Liming Gao , Star Zeng Date: Mon, 8 Oct 2018 09:29:15 +0800 Message-Id: <20181008012915.5968-1-dandan.bi@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 Subject: [patch] MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2018 01:29:51 -0000 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1224 When covert IFR binary to EFI_IFR_CHECKBOX structure, Current code has following incorrect code logic: IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1); The correct one should be: IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr; This patch is to fix this bug. Cc: Liming Gao Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- MdeModulePkg/Universal/HiiDatabaseDxe/Database.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c index 45448c5198..664687796f 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Database.c @@ -896,11 +896,11 @@ UpdateDefaultSettingInFormPackage ( break; case EFI_IFR_CHECKBOX_OP: IfrScope = IfrOpHdr->Scope; IfrQuestionType = IfrOpHdr->OpCode; IfrQuestionHdr = (EFI_IFR_QUESTION_HEADER *) (IfrOpHdr + 1); - IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1); + IfrCheckBox = (EFI_IFR_CHECKBOX *) IfrOpHdr; EfiVarStoreIndex = IsEfiVarStoreQuestion (IfrQuestionHdr, EfiVarStoreList, EfiVarStoreNumber); Width = sizeof (BOOLEAN); if (EfiVarStoreIndex < EfiVarStoreNumber) { for (Index = 0; Index < DefaultIdNumber; Index ++) { if (DefaultIdList[Index] == EFI_HII_DEFAULT_CLASS_STANDARD) { -- 2.18.0.windows.1