[PATCH 1/2] Revert "lib: string: Fix strlcpy return value", fix callers

Tom Rini trini at konsulko.com
Wed Aug 9 03:39:36 CEST 2023

On Fri, Jul 14, 2023 at 01:24:50PM +0200, Matthias Schiffer wrote:

> Both the Linux kernel and libbsd agree that strlcpy() should always
> return strlen(src) and not include the NUL termination. The incorrect
> U-Boot implementation makes it impossible to check the return value for
> truncation, and breaks code written with the usual implementation in
> mind (for example, fdtdec_add_reserved_memory() was subtly broken).
> I reviewed all callers of strlcpy() and strlcat() and fixed them
> according to my understanding of the intended function.
> This reverts commit d3358ecc54be0bc3b4dd11f7a63eab0a2842f772 and adds
> related fixes.
> Fixes: d3358ecc54be ("lib: string: Fix strlcpy return value")
> Signed-off-by: Matthias Schiffer <matthias.schiffer at ew.tq-group.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Sean Anderson <sean.anderson at seco.com>

Applied to u-boot/next, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230808/89012a74/attachment.sig>

More information about the U-Boot mailing list