From 209efccc6a489806d485c32e9af42c9a675767d5 Mon Sep 17 00:00:00 2001 From: xiaoxiaohuixxh Date: Tue, 10 Aug 2021 18:29:29 +0800 Subject: [PATCH] False effective head detection: fdt_totalsize(p) equal the len of dtb file should be legitimate Signed-off-by: xionghui li fdt_totalsize(p) gets the total size of fdt, this value should be allowed to be equal to the size of the bin file. --- fdtdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdtdump.c b/fdtdump.c index bdc0f94..60dd88f 100644 --- a/fdtdump.c +++ b/fdtdump.c @@ -169,7 +169,7 @@ static bool valid_header(char *p, size_t len) fdt_magic(p) != FDT_MAGIC || fdt_version(p) > MAX_VERSION || fdt_last_comp_version(p) > MAX_VERSION || - fdt_totalsize(p) >= len || + fdt_totalsize(p) > len || fdt_off_dt_struct(p) >= len || fdt_off_dt_strings(p) >= len) return 0;