amdfwtool: Check combo_index before checking the combo_config

Otherwise Checking combo_config[++combo_index] causes Out-of-Bounds
access.

Change-Id: I50d466ee98edfb18c01fc7ba43e929640b33c7c1
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73647
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>
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index f16f758..738123b 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -2789,7 +2789,8 @@
 					BHD2_COOKIE, &ctx);
 			}
 		}
-	} while (cb_config.use_combo && combo_config[++combo_index] != NULL);
+	} while (cb_config.use_combo && ++combo_index < MAX_COMBO_ENTRIES &&
+					combo_config[combo_index] != NULL);
 
 	targetfd = open(output, O_RDWR | O_CREAT | O_TRUNC, 0666);
 	if (targetfd >= 0) {