diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2017-04-18 12:52:08 +1000 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-04-18 12:52:08 +1000 |
commit | c2258841a785742a3fd5c423f4965caac73d01af (patch) | |
tree | 9ea6c9822a8754dd9fa76046154c61158ae2b7cb | |
parent | 9067ee4be0e6ac5090c30907da63e24514fd569e (diff) | |
download | dtc-c2258841a785742a3fd5c423f4965caac73d01af.zip dtc-c2258841a785742a3fd5c423f4965caac73d01af.tar.gz dtc-c2258841a785742a3fd5c423f4965caac73d01af.tar.bz2 |
fdtdump: Fix over-zealous version check
It's perfectly valid for a dtb to have version and last compat version set
to the same value, and that value can be 17 (the latest defined version).
However, since 0931cea "dtc: fdtdump: check fdt if not in scanning mode"
fdtdump will refuse to process such a dtb. We get away with this in many
cases because dtc's typical output has last compat version equal to 16,
rather than 17, but it's still a bug.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | fdtdump.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -165,7 +165,7 @@ static bool valid_header(char *p, off_t len) if (len < sizeof(struct fdt_header) || fdt_magic(p) != FDT_MAGIC || fdt_version(p) > MAX_VERSION || - fdt_last_comp_version(p) >= MAX_VERSION || + fdt_last_comp_version(p) > MAX_VERSION || fdt_totalsize(p) >= len || fdt_off_dt_struct(p) >= len || fdt_off_dt_strings(p) >= len) |