summaryrefslogtreecommitdiff
path: root/tests/Makefile.tests
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2017-11-14 22:45:56 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2018-06-07 11:48:20 +1000
commit70166d62a27f39b15f931b7bf3ffbaa1478fadcf (patch)
tree02e2873c95dfdbc946926cc45d57bd7502ef8598 /tests/Makefile.tests
parenteb890c0f77dcd98bb3f24755d50dfbe5eba11340 (diff)
downloaddevice-tree-compiler-70166d62a27f39b15f931b7bf3ffbaa1478fadcf.tar.gz
libfdt: Safer access to strings section
fdt_string() is used to retrieve strings from a DT blob's strings section. It's rarely used directly, but is widely used internally. However, it doesn't do any bounds checking, which means in the case of a corrupted blob it could access bad memory, which libfdt is supposed to avoid. This write a safe alternative to fdt_string, fdt_get_string(). It checks both that the given offset is within the string section and that the string it points to is properly \0 terminated within the section. It also returns the string's length as a convenience (since it needs to determine to do the checks anyway). fdt_string() is rewritten in terms of fdt_get_string() for compatibility. Most of the diff here is actually testing infrastructure. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'tests/Makefile.tests')
-rw-r--r--tests/Makefile.tests2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/Makefile.tests b/tests/Makefile.tests
index c670100..97f7f8d 100644
--- a/tests/Makefile.tests
+++ b/tests/Makefile.tests
@@ -29,7 +29,7 @@ LIB_TESTS_L = get_mem_rsv \
check_path check_header
LIB_TESTS = $(LIB_TESTS_L:%=$(TESTS_PREFIX)%)
-LIBTREE_TESTS_L = truncated_property
+LIBTREE_TESTS_L = truncated_property truncated_string
LIBTREE_TESTS = $(LIBTREE_TESTS_L:%=$(TESTS_PREFIX)%)
DL_LIB_TESTS_L = asm_tree_dump value-labels