mirror of
https://github.com/dgibson/dtc.git
synced 2025-12-09 05:05:20 -05:00
libfdt: Improve sequential write state checking
When creating a tree with the sequential write functions, certain things have to be done in a certain order. You must create the memory reserve map and only then can you create the actual tree structure. The -FDT_ERR_BADSTATE return code is for if you try to do things out of order. However, we weren't checking that very thoroughly, so it was possible to generate a corrupted blob if, for example, you started calling fdt_begin_node() etc. before calling fdt_finish_reservemap(). This makes the state checking more thorough disallow that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
04b5b4062c
commit
899d6fad93
5 changed files with 218 additions and 15 deletions
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
|
|
@ -58,6 +58,7 @@ tmp.*
|
|||
/subnode_offset
|
||||
/supernode_atdepth_offset
|
||||
/sw_tree1
|
||||
/sw_states
|
||||
/truncated_property
|
||||
/utilfdt_test
|
||||
/value-labels
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue