From b86b413a96f12d45debb91afdcb24def2ef4772a Mon Sep 17 00:00:00 2001 From: lgao4 Date: Mon, 22 Feb 2010 06:30:41 +0000 Subject: 1. Update GetStringWorker() of HiiDataBaseDxe to only search in other language and not update the StringSize to avoid GetString() buffer overflow. 2. Update SetupBrowser to correctly handle ordered list option. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10041 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 4 ++++ MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg/Universal/SetupBrowserDxe') diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index 02684e46ca..fc03834f1d 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -590,6 +590,9 @@ DestroyStatement ( if (Statement->BlockName != NULL) { FreePool (Statement->BlockName); } + if (Statement->BufferValue != NULL) { + FreePool (Statement->BufferValue); + } } @@ -1352,6 +1355,7 @@ ParseOpCodes ( CurrentStatement->MaxContainers = ((EFI_IFR_ORDERED_LIST *) OpCodeData)->MaxContainers; CurrentStatement->HiiValue.Type = EFI_IFR_TYPE_BUFFER; + CurrentStatement->BufferValue = NULL; if (Scope != 0) { SuppressForOption = TRUE; diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c b/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c index 639c04dafb..5eeec77af2 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c @@ -2,7 +2,7 @@ Implementation for handling the User Interface option processing. -Copyright (c) 2004 - 2009, Intel Corporation +Copyright (c) 2004 - 2010, 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 @@ -421,6 +421,12 @@ ProcessOptions ( switch (Question->Operand) { case EFI_IFR_ORDERED_LIST_OP: + // + // Check whether there are Options of this OrderedList + // + if (IsListEmpty (&Question->OptionListHead)) { + break; + } // // Initialize Option value array // @@ -508,6 +514,12 @@ ProcessOptions ( break; case EFI_IFR_ONE_OF_OP: + // + // Check whether there are Options of this OneOf + // + if (IsListEmpty (&Question->OptionListHead)) { + break; + } if (Selected) { // // Go ask for input -- cgit v1.2.3