audk/MdeModulePkg/Universal/HiiDatabaseDxe
Dandan Bi f76bc44362 MdeModulePkg/HiiDB: Avoid incorrect results of multiplication
An example:
The codes in function Output8bitPixel in Image.c:
OffsetY = BITMAP_LEN_8_BIT ((UINT32) Image->Width, Ypos);

Both Image->Width and Ypos are of type UINT16. They will be promoted to
int (signed) first, and then perform the multiplication defined by macro
BITMAP_LEN_8_BIT. If the result of multiplication between Image->Width and
Ypos exceeds the range of type int, a potential incorrect results
will be assigned to OffsetY.

This commit adds explicit UINT32 type cast for 'Image->Width' to avoid
possible overflow in the int range. And also fix similar issues in
HiiDatabase.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2017-04-18 15:56:22 +08:00
..
ConfigKeywordHandler.c MdeModulePkg: Replace [Ascii|Unicode]ValueToString 2017-03-02 09:58:11 +08:00
ConfigRouting.c MdeModulePkg: Replace [Ascii|Unicode]ValueToString 2017-03-02 09:58:11 +08:00
Database.c MdemodulePkg/HiiDatabase: Correct typo in comments. 2016-09-28 16:21:45 +08:00
Font.c MdeModulePkg: Refine casting expression result to bigger size 2017-03-06 14:33:20 +08:00
HiiDatabase.h MdeModulePkg/Universal: Fix typos in comments 2016-10-27 09:11:19 +08:00
HiiDatabase.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
HiiDatabaseDxe.inf MdeModulePkg/HiiDatabaseDxe.inf: Correct the GUID usages 2016-10-25 10:52:45 +08:00
HiiDatabaseEntry.c MdeModulePkg/HiiDatabase: Add HiiImageEx implementation. 2016-09-28 16:22:04 +08:00
HiiDatabaseExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
Image.c MdeModulePkg/HiiDB: Avoid incorrect results of multiplication 2017-04-18 15:56:22 +08:00
ImageEx.c MdeModulePkg/HiiDataBase: Fix NULL deference bug in HiiGetImageInfo 2016-10-09 10:18:35 +08:00
String.c MdeModulePkg/Universal: Fix typos in comments 2016-10-27 09:11:19 +08:00