diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2018-04-10 17:06:18 +1000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-07-19 07:01:11 +0200 |
commit | c4267b1e5f6ef5eb90d7cfdccdec196c9a7d3fec (patch) | |
tree | 7cd0675493bca039b662f981e85638c87bde62a4 /cpukit/dtc/libfdt/fdt.c | |
parent | libfdt: Clean up header checking functions (diff) | |
download | rtems-c4267b1e5f6ef5eb90d7cfdccdec196c9a7d3fec.tar.bz2 |
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>
Diffstat (limited to 'cpukit/dtc/libfdt/fdt.c')
0 files changed, 0 insertions, 0 deletions