From 53308a3e78cf12d1a858cb57cb58bec46b80677f Mon Sep 17 00:00:00 2001 From: qwang12 Date: Mon, 21 Jan 2008 13:23:33 +0000 Subject: UEFI Hii: Fix the bug based on the real root cause. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/UefiHiiEnable4354@4595 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index de84d74..4448be1 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -341,7 +341,7 @@ InitializeRequestElement ( if ((Question->Operand == EFI_IFR_PASSWORD_OP) && (Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK)) { // // Password with CALLBACK flag is stored in encoded format, - // so don't need to append it to \ + // so don't need to append it to // return EFI_SUCCESS; } @@ -354,13 +354,13 @@ InitializeRequestElement ( // Old String buffer is not sufficient for RequestElement, allocate a new one // StringSize = (Storage->ConfigRequest != NULL) ? StrSize (Storage->ConfigRequest) : 0; - NewStr = AllocateZeroPool ((StringSize + CONFIG_REQUEST_STRING_INCREMENTAL + 1) * sizeof (CHAR16)); + NewStr = AllocateZeroPool (StringSize + CONFIG_REQUEST_STRING_INCREMENTAL * sizeof (CHAR16)); if (Storage->ConfigRequest != NULL) { - StrCpy (NewStr, Storage->ConfigRequest); + CopyMem (NewStr, Storage->ConfigRequest, StringSize); gBS->FreePool (Storage->ConfigRequest); } Storage->ConfigRequest = NewStr; - Storage->SpareStrLen += CONFIG_REQUEST_STRING_INCREMENTAL; + Storage->SpareStrLen = CONFIG_REQUEST_STRING_INCREMENTAL; } StrCat (Storage->ConfigRequest, RequestElement); -- cgit v1.1