Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: e880c307c5808a9a972e5bf3b859396610edd67b
      
https://github.com/tianocore/edk2/commit/e880c307c5808a9a972e5bf3b859396610edd67b
  Author: Michael Kubacki <michael.kuba...@microsoft.com>
  Date:   2023-09-12 (Tue, 12 Sep 2023)

  Changed paths:
    M MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c

  Log Message:
  -----------
  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.w...@intel.com>
Cc: Liming Gao <gaolim...@byosoft.com.cn>
Cc: Dandan Bi <dandan...@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Signed-off-by: Michael Kubacki <michael.kuba...@microsoft.com>
Reviewed-by: Dandan Bi <dandan...@intel.com>




_______________________________________________
edk2-commits mailing list
edk2-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to