[edk2-devel] [PATCH v2] MdeModulePkg/HiiDatabaseDxe: Add check for 'Private->Attribute >> 4'
Zhang, Shenglei
shenglei.zhang at intel.com
Wed Oct 30 13:45:32 UTC 2019
The size of mHiiEfiColors is 16.
mHiiEfiColors[Private->Attribute >> 4] may be out of boundary.
So add a check for that.
Cc: Dandan Bi <dandan.bi at intel.com>
Cc: Eric Dong <eric.dong at intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang at intel.com>
---
v2: Instead of returing value, we add ASSERT to ensure
"Private->Attribute >> 4" is not out of boundary.
MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
index ca63df168c94..1eee5ec76bb0 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
@@ -999,6 +999,7 @@ GetSystemFont (
}
Info->ForegroundColor = mHiiEfiColors[Private->Attribute & 0x0f];
+ ASSERT ((Private->Attribute >> 4) < 16);
Info->BackgroundColor = mHiiEfiColors[Private->Attribute >> 4];
Info->FontInfoMask = EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_SYS_STYLE;
Info->FontInfo.FontStyle = 0;
--
2.18.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#49658): https://edk2.groups.io/g/devel/message/49658
Mute This Topic: https://groups.io/mt/39783598/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list