diff options
-rw-r--r-- | data.c | 2 | ||||
-rw-r--r-- | tests/embedded_nul.dts | bin | 0 -> 152 bytes | |||
-rw-r--r-- | tests/embedded_nul_equiv.dts | 6 | ||||
-rwxr-xr-x | tests/run_tests.sh | 4 |
4 files changed, 11 insertions, 1 deletions
@@ -74,7 +74,7 @@ struct data data_copy_escape_string(const char *s, int len) struct data d; char *q; - d = data_grow_for(empty_data, strlen(s)+1); + d = data_grow_for(empty_data, len + 1); q = d.val; while (i < len) { diff --git a/tests/embedded_nul.dts b/tests/embedded_nul.dts Binary files differnew file mode 100644 index 0000000..7b4993c --- /dev/null +++ b/tests/embedded_nul.dts diff --git a/tests/embedded_nul_equiv.dts b/tests/embedded_nul_equiv.dts new file mode 100644 index 0000000..e978204 --- /dev/null +++ b/tests/embedded_nul_equiv.dts @@ -0,0 +1,6 @@ +/dts-v1/; + +/ { + reserved-names = "aaaaaaaaaaaaaaaaaa\0bbbbbb\0ccccccccccccc"; + reserved-ranges = < 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 >; +}; diff --git a/tests/run_tests.sh b/tests/run_tests.sh index f94d361..ace6e4f 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -275,6 +275,10 @@ libfdt_tests () { run_dtc_test -I dts -O dtb -o sourceoutput.test.dtb sourceoutput.dts run_dtc_test -I dts -O dtb -o sourceoutput.test.dts.test.dtb sourceoutput.test.dts run_test dtbs_equal_ordered sourceoutput.test.dtb sourceoutput.test.dts.test.dtb + + run_dtc_test -I dts -O dtb -o embedded_nul.test.dtb embedded_nul.dts + run_dtc_test -I dts -O dtb -o embedded_nul_equiv.test.dtb embedded_nul_equiv.dts + run_test dtbs_equal_ordered embedded_nul.test.dtb embedded_nul_equiv.test.dtb } dtc_tests () { |