Skip to content

Commit 5ea30a0

Browse files
CodingVoidlgao4
authored andcommitted
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 <[email protected]>
1 parent b3a2f7f commit 5ea30a0

File tree

1 file changed

+1
-1
lines changed
  • MdeModulePkg/Universal/HiiDatabaseDxe

1 file changed

+1
-1
lines changed

MdeModulePkg/Universal/HiiDatabaseDxe/String.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ SetStringWorker (
10001000
case EFI_HII_SIBT_STRING_SCSU_FONT:
10011001
case EFI_HII_SIBT_STRINGS_SCSU:
10021002
case EFI_HII_SIBT_STRINGS_SCSU_FONT:
1003-
BlockSize = OldBlockSize + StrLen (String);
1003+
BlockSize = OldBlockSize + StrSize (String);
10041004
BlockSize -= AsciiStrSize ((CHAR8 *)StringTextPtr);
10051005
Block = AllocateZeroPool (BlockSize);
10061006
if (Block == NULL) {

0 commit comments

Comments
 (0)