misc: Implement grub_strlcpy()
authorB Horn <b@horn.uk>
Sat, 15 Jun 2024 01:33:08 +0000 (02:33 +0100)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commit458cce9ec4272ceb602e33d5cfb0ebc353bb304c
treee8bb505fcf2c16c522f2c79d60e208921081c756
parent34afbfc89446745d21c088eefb14050be7e64cdb
misc: Implement grub_strlcpy()

grub_strlcpy() acts the same way as strlcpy() does on most *NIX,
returning the length of src and ensuring dest is always NUL
terminated except when size is 0.

Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name misc-Implement-grub_strlcpy.patch
include/grub/misc.h