MdeModulePkg/HiiDatabaseDxe: Fix BlockSize length
The BlockSize calculation was missing the 0 terminator which caused the string block to shrink by 1 every time the string was processed. Therefore causing memory corruptions, because the string took more memory space as was allocated for the string block therefore corrupting the memory pool at the end (which caused an ASSERT upon trying to free it). Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
This commit is contained in:
parent
b3a2f7ff24
commit
5ea30a061c
|
@ -1000,7 +1000,7 @@ SetStringWorker (
|
|||
case EFI_HII_SIBT_STRING_SCSU_FONT:
|
||||
case EFI_HII_SIBT_STRINGS_SCSU:
|
||||
case EFI_HII_SIBT_STRINGS_SCSU_FONT:
|
||||
BlockSize = OldBlockSize + StrLen (String);
|
||||
BlockSize = OldBlockSize + StrSize (String);
|
||||
BlockSize -= AsciiStrSize ((CHAR8 *)StringTextPtr);
|
||||
Block = AllocateZeroPool (BlockSize);
|
||||
if (Block == NULL) {
|
||||
|
|
Loading…
Reference in New Issue