summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/HiiDatabaseDxe
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2018-09-28 13:28:03 +0800
committerLiming Gao <liming.gao@intel.com>2018-10-09 22:20:08 +0800
commit7f8aabef156128976f0c1389c154d25010653215 (patch)
treebc883720e05f106e1bfc9c686f2ca93422e2f0f6 /MdeModulePkg/Universal/HiiDatabaseDxe
parent50431b9cc70cd5a084ebd85436bfdd6e2e4b89a7 (diff)
downloadedk2-7f8aabef156128976f0c1389c154d25010653215.tar.gz
edk2-7f8aabef156128976f0c1389c154d25010653215.tar.bz2
edk2-7f8aabef156128976f0c1389c154d25010653215.zip
MdeModulePkg/HiiDB: Fix incorrect structure convention for checkbox
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; 1. The bug is in function "UpdateDefaultSettingInFormPackage()" which is to update the default setting of some HII Questions in the IFR binary data. So it only has impact when platform overrides default setting in HII VarStore through DynamicHii PCD setting in Platform DSC file. If platform doesn't override default setting, it has no impact. 2. The implementation updates the "Flags" filed in the EFI_IFR_CHECKBOX structure to update the default setting of checkbox. If using "IfrCheckBox = (EFI_IFR_CHECKBOX *) (IfrOpHdr + 1);" when wants to update the " Flags" filed in checkbox, but in fact it will update the opcode binary data(opcode binary length) behind checkbox binary. And then it will cause Browser can't parse the IFR binary data correctly. And then the possible symptom is that some HII Question and forms may be not parsed and then cannot be shown. This patch is to fix this bug. Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/HiiDatabaseDxe')
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/Database.c2
1 files changed, 1 insertions, 1 deletions
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
@@ -898,7 +898,7 @@ UpdateDefaultSettingInFormPackage (
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) {