amdfwtool: Add asserting before accessing array combo_config

Change-Id: Ia98fdbee4c4005562662313ebe2478d0aeb879bc
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73724
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Zheng Bao 2023-03-15 16:14:03 +08:00 committed by Martin L Roth
parent c9d743ca04
commit 7391722c40
1 changed files with 2 additions and 0 deletions

View File

@ -2296,6 +2296,7 @@ int main(int argc, char **argv)
break;
case AMDFW_OPT_COMBO1_CONFIG:
cb_config.use_combo = true;
assert_fw_entry(1, MAX_COMBO_ENTRIES, &ctx);
combo_config[1] = optarg;
break;
case AMDFW_OPT_MULTILEVEL:
@ -2676,6 +2677,7 @@ int main(int argc, char **argv)
* case.
*/
if (cb_config.use_combo && combo_index > 0) {
assert_fw_entry(combo_index, MAX_COMBO_ENTRIES, &ctx);
open_process_config(combo_config[combo_index], &cb_config,
debug);