audk/MdeModulePkg/Library/BootMaintenanceManagerUiLib
Michael Kubacki e880c307c5 MdeModulePkg/BootMaintenanceManagerUiLib: Check array index before access
Many arrays are defined with a length of MAX_MENU_NUMBER in
FormGuid.h. Two of those are BootOptionOrder and DriverOptionOrder.

In UpdatePage.c, a pointer is set to either of those arrays. The
array buffer is accessed using an index whose range is checked after
the pointer to the array is dereferenced. This change moves the check
before the dereference.

In another place in the file, the ConsoleCheck pointer is also set to
an array buffer with MAX_MENU_NUMBER elements. Only an ASSERT()
currently checks the range of the array index. This change
conditionalizes the pointer dereference itself on the range of Index.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
2023-09-12 02:43:14 +00:00
..
BmLib.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootMaintenance.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootMaintenanceManager.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootMaintenanceManager.vfr
BootMaintenanceManagerCustomizedUi.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootMaintenanceManagerCustomizedUi.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootMaintenanceManagerCustomizedUiSupport.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootMaintenanceManagerCustomizedUiSupport.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootMaintenanceManagerStrings.uni
BootMaintenanceManagerUiLib.inf
BootMaintenanceManagerUiLib.uni
BootOption.c MdeModulePkg: Fix conditionally uninitialized variables 2023-04-03 15:29:08 +00:00
ConsoleOption.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Data.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
FormGuid.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UpdatePage.c MdeModulePkg/BootMaintenanceManagerUiLib: Check array index before access 2023-09-12 02:43:14 +00:00
Variable.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00