mirror of https://github.com/acidanthera/audk.git
e880c307c5
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> |
||
---|---|---|
.. | ||
BmLib.c | ||
BootMaintenance.c | ||
BootMaintenanceManager.h | ||
BootMaintenanceManager.vfr | ||
BootMaintenanceManagerCustomizedUi.c | ||
BootMaintenanceManagerCustomizedUi.h | ||
BootMaintenanceManagerCustomizedUiSupport.c | ||
BootMaintenanceManagerCustomizedUiSupport.h | ||
BootMaintenanceManagerStrings.uni | ||
BootMaintenanceManagerUiLib.inf | ||
BootMaintenanceManagerUiLib.uni | ||
BootOption.c | ||
ConsoleOption.c | ||
Data.c | ||
FormGuid.h | ||
UpdatePage.c | ||
Variable.c |