summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJi Luo <ji.luo@nxp.com>2023-08-24 16:17:09 +0800
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2023-12-22 09:31:10 +0000
commit28dc906f6107ce8510a1ba07894ac966bad9b27d (patch)
tree67de9a0eb2533693ccc673c9d503b4d232bf46cc
parente5a026766feb22cfa8353eb23ded5635b8b6132e (diff)
MA-21597 check spl fit pointer before parsing it
the spl fit pointer could be set as NULL in HAB verify failed case, return error in such case. Change-Id: Idb44a19ca89f2a6065ea423782441e57109d6e3a Signed-off-by: Ji Luo <ji.luo@nxp.com> Upstream-Status: Inappropriate [downstream specific] Upstream U-Boot fixed this differently in combination with binman to create the final bootcontainer. Commit 6039e0edc854 ("imx: hab: Simplify the mechanism") Upstream-Status: Inappropriate [downstream specific] Upstream U-Boot fixed this differently in combination with binman to create the final bootcontainer. Commit 6039e0edc854 ("imx: hab: Simplify the mechanism") Backport from NXP downstream [6cb283bb4e19da6667abaedd83efc23a15fdc48d] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
-rw-r--r--common/spl/spl_fit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 9d5a6dccec..1ab201b2f2 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -736,6 +736,9 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
return 0;
ctx.fit = spl_load_simple_fit_fix_load(ctx.fit);
+ if (ctx.fit == NULL) {
+ return -1;
+ }
ret = spl_simple_fit_parse(&ctx);
if (ret < 0)