False effective head detection: fdt_totalsize(p) equal the len of dtb

file should be legitimate

Signed-off-by: xionghui li <juicemail@163.com>

fdt_totalsize(p) gets the total size of fdt, this value should be
allowed to be equal to the size of the bin file.
This commit is contained in:
xiaoxiaohuixxh 2021-08-10 18:29:29 +08:00
parent 0869f82691
commit 209efccc6a

View file

@ -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;