summaryrefslogtreecommitdiffstats
path: root/cpukit/dtc/libfdt/fdt_rw.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* libfdt: Remove undefined behaviour setting empty propertiesDavid Gibson2018-07-191-1/+2
| | | | | | | | | | | | | | The standard way of setting an empty property using libfdt is: fdt_setprop(fdt, nodeoffset, propname, NULL, 0); However, the implementation of this includes an unconditional: memcpy(prop->data, NULL, 0); Which although it will be a no-op (which is what we want) on many platforms is technically undefined behaviour. Correct this, so that when passing a 0 length, passing a NULL pointer as the value to fdt_setprop() is definitely safe. This should quiet static checkers which complain about this. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: simplify fdt_del_mem_rsv()Masahiro Yamada2018-07-191-5/+1
| | | | | | | The variable "err" is unneeded. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* libfdt: check for potential overrun in _fdt_splice()Courtney Cavin2018-07-191-0/+2
| | | | | | | | | | | | This patch catches the conditions where: - 'splicepoint' is set to a point outside of [ fdt, fdt_totalsize(fdt) ) - 'newlen' is negative, or 'splicepoint' plus 'newlen' results in overflow Either of these cases can be caused by math which overflows in calling functions, or by sizes specified through dynamic means. Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
* libfdt: Initial importSebastian Huber2015-10-161-0/+492
Import from: git://git.kernel.org/pub/scm/utils/dtc/dtc.git Commit: 604e61e081e3c6c8fa1a8189c71cb3908a5bbc1e Date: 2015-09-29T09:09:08Z