Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

valid_header function may be have some problem. #52

Closed
juiceRv opened this issue Aug 10, 2021 · 3 comments · May be fixed by #53
Closed

valid_header function may be have some problem. #52

juiceRv opened this issue Aug 10, 2021 · 3 comments · May be fixed by #53

Comments

@juiceRv
Copy link

juiceRv commented Aug 10, 2021

dtc/fdtdump.c

Line 166 in ecfb438

static bool valid_header(char *p, size_t len)

This function should be modified like this?

static bool valid_header(char *p, size_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_totalsize(p) > len ||
	    fdt_off_dt_struct(p) >= len ||
	    fdt_off_dt_strings(p) >= len)
		return 0;
	else
		return 1;
}
@juiceRv
Copy link
Author

juiceRv commented Aug 10, 2021

@dgibson
Copy link
Owner

dgibson commented Feb 2, 2023

@juiceRv sorry, I don't understand what change you're suggesting. The code you quote appears to be identical to what's in dtc now.

@dgibson
Copy link
Owner

dgibson commented Feb 27, 2023

No response to query, so closing.

@dgibson dgibson closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants