coreboot/src/commonlib
Jeremy Compostella eb93808fa5 commonlib/fsp_relocate: Fix potential NULL pointer dereference
Commit 1df1cf994a ("commonlib/fsp_relocate: add PE32 section
support") introduced a potential NULL pointer dereference if there is
PE32 binary to relocate outside of the first firmware volume.

The `fih_offset' pointer was used as an output variable but now it is
also used as an input variable to pass the FSP information header to
the `pe_relocate()' function.

This commit resolves this potential NULL-pointer dereference by
passing the pointer systematically and without affecting the logic as
it is only set if it has not been set before.

Change-Id: I9fad90a60854d5f050aa044a5c0b3af91c99df4a
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78501
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-11-02 13:29:04 +00:00
..
bsd cbfs: Restore 32-bit padding in cbfs_header 2023-10-06 10:11:31 +00:00
include/commonlib {commonlib, libpayload}: Add "has_external_display" in coreboot table 2023-10-04 18:50:49 +00:00
storage commonlib/storage: Add attach callback to sdhci_ctrlr 2023-02-08 16:59:28 +00:00
fsp_relocate.c commonlib/fsp_relocate: Fix potential NULL pointer dereference 2023-11-02 13:29:04 +00:00
iobuf.c src/commonlib: Clean up includes 2022-10-26 16:27:10 +00:00
Makefile.inc commonlib,console,nb,sb,security: Add SPDX licenses to Makefiles 2023-08-14 15:14:45 +00:00
mem_pool.c commonlib/mem_pool: Allow configuring the alignment 2021-11-04 10:33:52 +00:00
rational.c commonlib: Add support for rational number approximation 2022-08-03 03:26:13 +00:00
region.c src/commonlib: Clean up includes 2022-10-26 16:27:10 +00:00
sort.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00