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
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
HiiDatabaseDxe.inf
HiiDatabaseEntry.c
HiiDatabaseExtra.uni
Image.c MdeModulePkg/HiiDB: Avoid incorrect results of multiplication 2017-04-18 15:56:22 +08:00
ImageEx.c
String.c MdeModulePkg/Universal: Fix typos in comments 2016-10-27 09:11:19 +08:00