u-boot/test/lib
Matthias Schiffer 615828721a Revert "lib: string: Fix strlcpy return value", fix callers
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 d3358ecc54 and adds
related fixes.

Fixes: d3358ecc54 ("lib: string: Fix strlcpy return value")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2023-08-08 17:05:43 -04:00
..
abuf.c abuf: Correct a corner case with abuf_realloc() 2022-04-06 14:01:42 -04:00
asn1.c lib/crypto, efi_loader: move some headers to include/crypto 2020-05-04 12:26:11 +02:00
cmd_ut_lib.c test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
efi_device_path.c test: unit test for efi_dp_check_length() 2020-08-24 16:37:53 +02:00
efi_image_region.c test: provide tests for efi_image_region_add() 2020-07-03 18:03:41 +02:00
getopt.c test: Add a test for getopt 2020-10-30 10:56:11 -04:00
hexdump.c test: call hexdump tests via ut lib 2019-04-22 18:13:21 -04:00
Kconfig test: improve configuration for Kconfig test options 2023-04-25 15:31:27 -04:00
kconfig.c test: Wrap assert macros in ({ ... }) and fix missing semicolons 2023-03-14 16:08:51 -06:00
kconfig_spl.c test: Wrap assert macros in ({ ... }) and fix missing semicolons 2023-03-14 16:08:51 -06:00
lmb.c test: lmb: Rework lib_test_lmb_max_regions test to scale 2023-02-08 14:09:39 -05:00
longjmp.c test: unit test for longjmp 2021-04-08 15:37:29 +08:00
Makefile Revert "Merge branch '2023-07-24-introduce-FF-A-suppport'" 2023-07-24 19:51:05 -04:00
rsa.c test: add rsa_verify() unit test 2020-03-12 08:20:39 -04:00
sscanf.c lib: sscanf: add sscanf implementation 2020-08-14 15:18:30 -04:00
string.c lib: Add memdup() 2021-10-08 15:53:26 -04:00
strlcat.c Revert "lib: string: Fix strlcpy return value", fix callers 2023-08-08 17:05:43 -04:00
test_aes.c common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
test_crc8.c test: unit test for crc8 2023-03-13 13:56:14 +01:00
test_crypt.c lib: wrap crypt API to hide errno usage 2021-07-23 13:36:20 -04:00
test_errno_str.c test: provide test for errno_str() 2019-10-31 07:22:53 -04:00
test_print.c display_options: print_size: Fix order overflow 2022-09-23 15:13:18 -04:00