dtc/tests/testdata.h
David Gibson 9825f823eb libfdt: Fix bounds-checking bug in fdt_get_property()
The libfdt functions are supposed to behave tolerably well when practical,
even if given a corrupted device tree as input.  A silly mistake in
fdt_get_property() means we're bounds checking against the size of a pointer
instead of the size of a property header, meaning we can get bogus
behaviour in a corrupted device tree where the structure block ends in
what's supposed to be the middle of a property.

This patch corrects the problem (fdt_get_property() will now return
BADSTRUCTURE in this case), and also adds a testcase to catch the bug.
2006-12-14 15:29:25 +11:00

9 lines
233 B
C

#define TEST_VALUE_1 0xdeadbeef
#define TEST_VALUE_2 0xabcd1234
#define TEST_STRING_1 "hello world"
#ifndef __ASSEMBLY__
extern struct fdt_header _test_tree1;
extern struct fdt_header _truncated_property;
#endif /* ! __ASSEMBLY */