Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MdeModulePkg/BootMaintenanceManagerUiLib: Check array index before ac…
…cess 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 <[email protected]> Cc: Liming Gao <[email protected]> Cc: Dandan Bi <[email protected]> Cc: Eric Dong <[email protected]> Signed-off-by: Michael Kubacki <[email protected]> Reviewed-by: Dandan Bi <[email protected]>
- Loading branch information