fdt_check_node_offset_() checks for a valid offset but also changes the offset by calling fdt_next_tag(). Hence, do not skip this function if ASSUME_VALID_INPUT is set. Actually this works similar to fdt_check_prop_offset_(). --- libfdt/fdt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libfdt/fdt.c b/libfdt/fdt.c index c28fcc1..39ed8ed 100644 --- a/libfdt/fdt.c +++ b/libfdt/fdt.c @@ -206,8 +206,6 @@ uint32_t fdt_next_tag(const void *fdt, int startoffset, int *nextoffset) int fdt_check_node_offset_(const void *fdt, int offset) { - if (can_assume(VALID_INPUT)) - return offset; if ((offset < 0) || (offset % FDT_TAGSIZE) || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE)) return -FDT_ERR_BADOFFSET; -- 2.28.0