coreboot/util/amdfwtool
Martin Roth 9411c6e7c7 util/amdfwtool: Fix NULL pointer dereference in fill_dir_header
Move the NULL pointer check to the beginning of the fill_dir_header function
before any dereference of the directory pointer. This prevents the potential
segmentation fault that could occur if directory is NULL.

This fixes CID 1540835 - Dereference before null check (REVERSE_NULL).

Change-Id: I12bb146d59839381478034f974b7d408f92ae677
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88617
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-08-02 01:46:47 +00:00
..
.gitignore util/amdfwtool: Add amdfwread utility 2022-05-13 15:51:37 +00:00
amdfwread.c util/amdfwtool/amdfwread.c: Properly error out in relative_offset() 2025-06-28 16:23:51 +00:00
amdfwtool.c util/amdfwtool: Fix NULL pointer dereference in fill_dir_header 2025-08-02 01:46:47 +00:00
amdfwtool.h util/amdfwtool: Add binary parsing 2025-07-17 20:38:52 +00:00
data_parse.c util/amdfwtool: Add binary parsing 2025-07-17 20:38:52 +00:00
description.md
handle_file.c amdfwtool: Move the functions to handle_file.c 2024-03-04 14:50:53 +00:00
Makefile amdfwtool: Use Makefile.mk for Makefile settings 2024-02-29 02:24:09 +00:00
Makefile.mk amdfwtool: Move code related to getting options to a new file 2024-03-06 11:05:07 +00:00
opts.c util/amdfwtool: Do not attempt to continue processing --help 2025-06-04 17:33:46 +00:00
signed_psp.c util/amdfwtool: add PLATFORM_FAEGAN 2025-04-02 16:02:47 +00:00