audk/MdeModulePkg/Universal/HiiDatabaseDxe
Ray Ni 89910a39dc MdeModulePkg/HiiImage: Fix stack overflow when corrupted BMP is parsed (CVE-2018-12181)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1135

For 4bit BMP, there are only 2^4 = 16 colors in the palette.
But when a corrupted BMP contains more than 16 colors in the palette,
today's implementation wrongly copies all colors to the local
PaletteValue[16] array which causes stack overflow.

The similar issue also exists in the logic to handle 8bit BMP.

The patch fixes the issue by only copies the first 16 or 256 colors
in the palette depending on the BMP type.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
2019-03-08 23:44:59 +08:00
..
ConfigKeywordHandler.c MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
ConfigRouting.c MdeModulePkg HiiDatabaseDxe: Remove a redundant function 2018-08-21 16:29:08 +08:00
Database.c MdeModulePkg/HiiDB: Make sure database update behaviors are atomic 2018-10-26 15:08:44 +08:00
Font.c MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
HiiDatabase.h MdeModulePkg/HiiDB: Make sure database update behaviors are atomic 2018-10-26 15:08:44 +08:00
HiiDatabase.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
HiiDatabaseDxe.inf MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
HiiDatabaseEntry.c MdeModulePkg/HiiDB: Reorganize codes of exporting HII settings 2018-10-26 15:08:40 +08:00
HiiDatabaseExtra.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00
Image.c MdeModulePkg/HiiImage: Fix stack overflow when corrupted BMP is parsed (CVE-2018-12181) 2019-03-08 23:44:59 +08:00
ImageEx.c MdeModulePkg/HiiDataBase: Fix NULL deference bug in HiiGetImageInfo 2016-10-09 10:18:35 +08:00
String.c MdeModulePkg/HiiDB: Make sure database update behaviors are atomic 2018-10-26 15:08:44 +08:00