MdeModulePkg/HiiDatabaseDxe: Correct the ReallocatePool size

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Dandan Bi 2016-04-12 10:53:42 +08:00 committed by Star Zeng
parent 622ce64508
commit 9b72af13e2
1 changed files with 2 additions and 1 deletions

View File

@ -600,11 +600,11 @@ MergeDefaultString (
if (StringPtr == NULL) { if (StringPtr == NULL) {
StringPtrEnd = StrStr (StringPtrDefault + 1, L"&GUID"); StringPtrEnd = StrStr (StringPtrDefault + 1, L"&GUID");
SizeAltCfgResp = StrSize (*AltCfgResp); SizeAltCfgResp = StrSize (*AltCfgResp);
TotalSize = SizeAltCfgResp + StrSize (StringPtrDefault);
if (StringPtrEnd == NULL) { if (StringPtrEnd == NULL) {
// //
// No more default string is found. // No more default string is found.
// //
TotalSize = SizeAltCfgResp + StrSize (StringPtrDefault);
*AltCfgResp = (EFI_STRING) ReallocatePool ( *AltCfgResp = (EFI_STRING) ReallocatePool (
SizeAltCfgResp, SizeAltCfgResp,
TotalSize, TotalSize,
@ -619,6 +619,7 @@ MergeDefaultString (
} else { } else {
TempChar = *StringPtrEnd; TempChar = *StringPtrEnd;
*StringPtrEnd = L'\0'; *StringPtrEnd = L'\0';
TotalSize = SizeAltCfgResp + StrSize (StringPtrDefault);
*AltCfgResp = (EFI_STRING) ReallocatePool ( *AltCfgResp = (EFI_STRING) ReallocatePool (
SizeAltCfgResp, SizeAltCfgResp,
TotalSize, TotalSize,