Attention is currently required from: Zheng Bao. Hello Zheng Bao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/54999
to review the following change.
Change subject: amdfwtool: Null check the ponters before being used ......................................................................
amdfwtool: Null check the ponters before being used
Reported by coverity CID:1438963 BUG=b:188769922
Change-Id: Ia520e33c9e4065236478665fb0ef047fa47c9b81 Signed-off-by: Zheng Bao fishbaozi@gmail.com --- M util/amdfwtool/amdfwtool.c 1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/54999/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c index 9aed7d0..899f3dc 100644 --- a/util/amdfwtool/amdfwtool.c +++ b/util/amdfwtool/amdfwtool.c @@ -511,10 +511,13 @@
if (!count) return; + if (ctx == NULL) + return; + if (directory == NULL) + return;
/* The table size needs to be 0x1000 aligned. So align the end of table. */ - if (ctx != NULL) - ctx->current = ALIGN(ctx->current, TABLE_ALIGNMENT); + ctx->current = ALIGN(ctx->current, TABLE_ALIGNMENT);
switch (cookie) { case PSP2_COOKIE: