On Tue, 21 Apr 2026 09:54:30 +0200, Rasmus Villemoes wrote:

> There are quite a few places where we allocate X+1 bytes, initialize
> the first X bytes via memcpy() and then set the last byte to 0.
> 
> The kernel has a helper for that, kmemdup_nul(). Introduce a similar
> one, and start making use of it in a few places. Also the existing
> memdup() helper can be put to more use.
> 
> [...]

Applied to u-boot/next, thanks!

[1/9] string: fix prototype of memdup()
      commit: ca1c292d2ee6bcb06be71400d25ae37e9dc2c1aa
[2/9] stdio: drop stdio_clone
      commit: 719cacb92e039308e23cbd6b653275e939a5aca5
[3/9] lib/string.c: drop pointless __HAVE_ARCH_STRDUP
      commit: 349d148f16d83da3b1e3475be0e43bfda4f4ab71
[4/9] lib/string.c: introduce memdup_nul() helper
      commit: 8c664d2135723a110a60b792a8614c4864ad82a3
[5/9] lib/string.c: implement strdup() and strndup() in terms of memdup_nul()
      commit: ee8be5d4a1035de232b3497563fe9f6773775f96
[6/9] lib/hashtable.c: use memdup_nul() in himport_r
      commit: b87ff4878d081103c45f0ebea7528609a0b173f3
[7/9] common/cli.c: use memdup_nul() in run_command_list()
      commit: 11168813bf9c088e1fce8a96f4b493ee815c966b
[8/9] drivers/core: use memdup() instead of malloc()+memcpy()
      commit: 4ef201e607ebed2432ee929446e3fb9b57c53a54
[9/9] test: lib: add test of memdup_nul()
      commit: 8d209186a1e4aca4ec44745d05d51de7e80f7e3e
-- 
Tom


Reply via email to