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

View File

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