audk/UefiCpuPkg/PiSmmCpuDxeSmm
Marvin H?user 4222e8e7e4 UefiCpuPkg/PiSmmCpuDxeSmm: Fix ASSERT for success.
Index is initialized to MAX_UINT16 as default failure value, which
is what the ASSERT is supposed to test for.  The ASSERT condition
however can never return FALSE for INT16 != int, as due to
Integer Promotion[1], Index is converted to int, which can never
result in -1.

Furthermore, Index is used as a for loop index variable inbetween its
initialization and the ASSERT, so the value is unconditionally
overwritten too.

Fix the ASSERT check to compare Index to its upper boundary, which it
will be equal to if the loop was not broken out of on success.

[1] ISO/IEC 9899:2011, 6.5.9.4

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2018-10-30 10:21:33 +08:00
..
Ia32 UefiCpuPkg/PiSmmCpuDxeSmm: implement non-stop mode for SMM 2018-08-30 07:22:30 +08:00
X64 UefiCpuPkg/PiSmmCpuDxeSmm: Fix ASSERT for success. 2018-10-30 10:21:33 +08:00
CpuS3.c UefiCpuPkg/PiSmmCpuDxeSmm: Fix build failure for VS2012 and GCC49. 2018-10-26 11:28:37 +08:00
CpuService.c UefiCpuPkg/LocalApicLib: Rename GetProcessorLocation() 2016-11-02 09:16:21 +08:00
CpuService.h UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files 2015-10-19 19:12:53 +00:00
MpService.c UefiCpuPkg/PiSmmCpuDxeSmm: Clean up useless code. 2018-10-26 11:28:37 +08:00
PiSmmCpuDxeSmm.c UefiCpuPkg/PiSmmCpuDxeSmm: [CVE-2017-5753] Fix bounds check bypass 2018-09-30 13:06:42 +08:00
PiSmmCpuDxeSmm.h UefiCpuPkg/PiSmmCpuDxeSmm: Clean up useless code. 2018-10-26 11:28:37 +08:00
PiSmmCpuDxeSmm.inf UefiCpuPkg PiSmmCpuDxeSmm: Use new EfiLocateFirstAcpiTable() 2018-09-27 14:25:36 +08:00
PiSmmCpuDxeSmm.uni UefiCpuPkg: Convert all .uni files to utf-8 2015-12-15 04:59:14 +00:00
PiSmmCpuDxeSmmExtra.uni UefiCpuPkg: Convert all .uni files to utf-8 2015-12-15 04:59:14 +00:00
SmmCpuMemoryManagement.c UefiCpuPkg/PiSmmCpuDxeSmm: Avoid possible NULL ptr dereference 2018-07-31 13:07:47 +08:00
SmmProfile.c UefiCpuPkg PiSmmCpuDxeSmm: Use new EfiLocateFirstAcpiTable() 2018-09-27 14:25:36 +08:00
SmmProfile.h UefiCpuPkg/PiSmmCpuDxeSmm: implement non-stop mode for SMM 2018-08-30 07:22:30 +08:00
SmmProfileInternal.h UefiCpuPkg PiSmmCpuDxeSmm: Use new EfiLocateFirstAcpiTable() 2018-09-27 14:25:36 +08:00
SmramSaveState.c UefiCpuPkg/PiSmmCpuDxeSmm: patch "gSmiCr3" with PatchInstructionX86() 2018-04-04 16:44:06 +02:00
SyncTimer.c UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files 2015-10-19 19:12:53 +00:00