Skip to content

Commit

Permalink
False effective head detection: fdt_totalsize(p) equal the len of dtb
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
xiaoxiaohuixxh committed Aug 14, 2021
1 parent 0869f82 commit 209efcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fdtdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 209efcc

Please sign in to comment.