summaryrefslogtreecommitdiff
path: root/util/amdfwtool
diff options
context:
space:
mode:
authorZheng Bao <fishbaozi@gmail.com>2023-03-15 16:14:03 +0800
committerMartin L Roth <gaumless@gmail.com>2023-03-16 14:39:41 +0000
commit7391722c40c2ba598072a44ed71b692090e8af82 (patch)
treef797284ccda0a1c4abe5c019f74acd06526c480b /util/amdfwtool
parentc9d743ca0490e3849af1e9e825b364180c79c9a5 (diff)
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>
Diffstat (limited to 'util/amdfwtool')
-rw-r--r--util/amdfwtool/amdfwtool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index fc0668fab6..f16f758cf7 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -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);