dtc/libfdt
David Gibson 19b898409b libfdt: Don't zero alignment padding bytes if there aren't any
Some recent patches fixed bugs where we didn't correctly zero padding bytes
inserted to correctly align out structures.  However, the way it was done
potentially calls memset() with a zero length, which may not be safe on all
platforms.  Correct it.

Correcting that exposes some careless mixing of signed and unsigned values,
so fix that as well.

Fixes: 5036c259132f ("libfdt: Zero padding in sequential write")
Fixes: cb9570afe7a4 ("libfdt: Zero name padding in fdt_set_name")
Fixes: ce51dcbd84 ("libfdt: Zero the padding after a property value")
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2026-11-23 11:47:36 +11:00
..
.gitignore Link tools and tests against libfdt shared library 2019-03-29 17:20:16 +11:00
Makefile.libfdt libfdt: rename libfdt-X.Y.Z.so to libfdt.so.X.Y.Z 2023-08-06 14:53:29 +10:00
TODO libfdt: Document most remaining functions 2025-08-01 11:34:18 +10:00
fdt.c libfdt: Speed up fdt_find_string_len_() with memchr() 2026-11-17 14:56:10 +11:00
fdt.h Use __ASSEMBLER__ instead of __ASSEMBLY__ 2025-03-14 13:51:31 +11:00
fdt_addresses.c libfdt: fix an incorrect integer promotion 2021-11-17 12:22:53 +11:00
fdt_check.c libfdt: fdt_check_full: Add can_assume(PERFECT) check 2026-06-17 15:31:29 +10: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: Bounds check local fixup offsets 2026-11-17 11:03:53 +11:00
fdt_ro.c libfdt: Fix fdt_get_path() reading before the start of the buffer 2026-11-11 13:40:12 +11:00
fdt_rw.c libfdt: Don't zero alignment padding bytes if there aren't any 2026-11-23 11:47:36 +11:00
fdt_strerror.c libfdt: Add ALIGNMENT error string 2021-08-02 12:21:53 +10:00
fdt_sw.c libfdt: Don't zero alignment padding bytes if there aren't any 2026-11-23 11:47:36 +11:00
fdt_wip.c libfdt: overlay: Fix out-of-bounds write on bad fixup offset 2026-11-02 15:38:53 +11:00
libfdt.h libfdt: Revert accidental ABI breakage 2026-05-28 11:52:59 +10:00
libfdt_env.h libfdt: Remove old MacOS strnlen workaround 2025-09-30 12:03:03 +10:00
libfdt_internal.h libfdt: Find a node's parent in a single pass 2026-10-27 13:14:52 +11:00
meson.build libfdt: pass sources as keyword argument to library() 2026-09-08 21:11:38 +10:00
sbom.cdx.json libfdt: Move the SBOM authors section 2024-11-20 16:16:57 +11:00
version.lds libfdt: Add fdt_setprop_namelen() 2024-12-06 16:42:25 +11:00