]> git.ipfire.org Git - thirdparty/u-boot.git/commit
test: dm: fdtdec: Validate FDT size in unit test
authorAdriana Nicolae <adriana@arista.com>
Tue, 9 Dec 2025 15:55:38 +0000 (07:55 -0800)
committerTom Rini <trini@konsulko.com>
Wed, 10 Dec 2025 15:28:40 +0000 (09:28 -0600)
commit93d000bc5237a82e74d437b5fc3c5fdf5237df2d
treec51080c8bf146842d1d80aa5427875083663c4b4
parentda54deb1ac8ee65475c7dca556df751b7e31806e
test: dm: fdtdec: Validate FDT size in unit test

The current FDT decoding tests calculate the memory required
for FDT manipulation by directly adding a fixed margin to
fdt_totalsize(gd->fdt_blob). The static analyzer flagged
"gd->fdt_blob->totalsize" as a tainted value being passed
to fdt_open_into().

Ensure the size is validated by checking that the total size
is within a reasonable maximum FDT limit for unit tests.

Signed-off-by: Adriana Nicolae <adriana@arista.com>
test/dm/fdtdec.c