eficonfig: set EFICONFIG_ENTRY_NUM_MAX to INT_MAX - 1
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Thu, 2 Feb 2023 09:24:45 +0000 (18:24 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 10 Feb 2023 12:05:39 +0000 (13:05 +0100)
commit1f0583beeb32b0eab4d87ea9c0bef247432aa0c6
tree8acc77a75cf740eb55aa6924fa28efdfec61734c
parent88df36346c767f8756e54cc1941b6cda180b61db
eficonfig: set EFICONFIG_ENTRY_NUM_MAX to INT_MAX - 1

eficonfig_append_menu_entryi() accepts the number of entries
less than or equal to EFICONFIG_ENTRY_NUM_MAX.
EFICONFIG_ENTRY_NUM_MAX is currently set as INT_MAX, so
the invalid menu count check(efi_menu->count > EFICONFIG_ENTRY_NUM_MAX)
in eficonfig_process_common() is always false.

This commit sets EFICONFIG_ENTRY_NUM_MAX to (INT_MAX - 1).

Reported-by: Coverity (CID 435659)
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
include/efi_config.h