platform_external_dtc/libfdt
LoveSy c0c2e115f8 Fix a UB when fdt_get_string return null
When fdt_get_string return null, `namep` is not correctly reset.
From the document of `fdt_getprop_by_offset`, the parameter `namep` will
be always overwritten (that is, it will be overwritten without exception
of error occurance).

As for the caller (like
e097c097fe/native/jni/magiskboot/dtb.cpp (L42)),
the code may be like:
```cpp
size_t size;
const char *name;
auto *value = fdt_getprop_by_offset(fdt, prop, &name, &size);
```
and if `value == nullptr`, `size` is also be overwritten correctly but
`name` is not, which is quite inconsistent.

This commit makes sure `name` and `size` behavior consistently (reset to
reasonable value) when error occurs.

Signed-off-by: LoveSy <shana@zju.edu.cn>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-28 20:11:11 +11:00
..
.gitignore Link tools and tests against libfdt shared library 2019-03-29 17:20:16 +11:00
fdt.c libfdt: Add FDT alignment check to fdt_check_header() 2021-04-07 12:44:19 +10:00
fdt.h libfdt: Replace GPL/BSD boilerplate/reference with SPDX tags 2019-06-21 21:06:10 +10:00
fdt_addresses.c libfdt: fix an incorrect integer promotion 2021-11-17 12:22:53 +11:00
fdt_check.c libfdt: Check that the root-node name is empty 2021-03-23 12:13:06 +11:00
fdt_empty_tree.c libfdt: Replace GPL/BSD boilerplate/reference with SPDX tags 2019-06-21 21:06:10 +10:00
fdt_overlay.c libfdt: overlay: make overlay_get_target() public 2021-11-18 16:25:10 +11:00
fdt_ro.c Fix a UB when fdt_get_string return null 2021-12-28 20:11:11 +11:00
fdt_rw.c Fix CID 1461557 2021-06-08 16:32:59 +10:00
fdt_strerror.c libfdt: Add ALIGNMENT error string 2021-08-02 12:21:53 +10:00
fdt_sw.c Set last_comp_version correctly in new dtb and fix potential version issues in fdt_open_into 2021-01-04 12:26:37 +11:00
fdt_wip.c libfdt: libfdt_wip: Fix comparison warning 2020-10-02 10:30:07 +10:00
libfdt.h libfdt: overlay: make overlay_get_target() public 2021-11-18 16:25:10 +11:00
libfdt_env.h libfdt: Replace GPL/BSD boilerplate/reference with SPDX tags 2019-06-21 21:06:10 +10:00
libfdt_internal.h libfdt: Tweak description of assume-aligned load helpers 2020-12-16 16:52:17 +11:00
Makefile.libfdt libfdt: Allow exclusion of fdt_check_full() 2020-02-24 13:38:44 +11:00
meson.build libfdt: Add static lib to meson build 2021-11-11 14:27:09 +11:00
TODO dtc: Update TODO files 2007-12-19 08:20:26 -06:00
version.lds libfdt: overlay: make overlay_get_target() public 2021-11-18 16:25:10 +11:00