audk/EmulatorPkg/Win/Host
wenyi,xie via groups.io dd5c7e3c52 EmulatorPkg/host: fix overflow in Mult
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2947

When calculating memory regions and store the information in the
gSystemMemory in file WinHost.c, the code below will cause overflow,
because _wtoi (MemorySizeStr) return an int value and SIZE_1MB is
also an int value, if MemorySizeStr is lager for example 2048, then
result of multiplication will overflow.

for (Index = 0, Done = FALSE; !Done; Index++) {
  //
  // Save the size of the memory and make a Unicode filename SystemMemory00
  //
  gSystemMemory[Index].Size = _wtoi (MemorySizeStr) * SIZE_1MB;

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
2020-09-23 02:53:41 +00:00
..
WinBlockIo.c EmulatorPkg/Win: Fix various typos 2020-02-10 22:30:07 +00:00
WinFileSystem.c EmulatorPkg/Win: Fix various typos 2020-02-10 22:30:07 +00:00
WinGop.h EmulatorPkg/Win: Fix various typos 2020-02-10 22:30:07 +00:00
WinGopInput.c EmulatorPkg/Win: Fix various typos 2020-02-10 22:30:07 +00:00
WinGopScreen.c EmulatorPkg/Win: Fix various typos 2020-02-10 22:30:07 +00:00
WinHost.c EmulatorPkg/host: fix overflow in Mult 2020-09-23 02:53:41 +00:00
WinHost.h EmulatorPkg/WinHost: Enable network support. 2020-06-04 08:41:07 +00:00
WinHost.inf EmulatorPkg/WinHost: Enable network support. 2020-06-04 08:41:07 +00:00
WinInclude.h WinHost: Add SimplePointer support 2019-10-21 10:08:09 +08:00
WinMemoryAllocationLib.c EmulatorPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:59 -07:00
WinPacketFilter.c EmulatorPkg/WinHost: Enable network support. 2020-06-04 08:41:07 +00:00
WinThunk.c EmulatorPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:59 -07:00