[PATCH 9/9] boot: Use strlcpy() in label_boot()
Simon Glass
sjg at chromium.org
Tue May 26 15:09:15 CEST 2026
This function is recommended instead of strncpy() since it always
terminates the string.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
boot/pxe_utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c
index 419ab1f1b0e..e97faeec0bb 100644
--- a/boot/pxe_utils.c
+++ b/boot/pxe_utils.c
@@ -646,7 +646,7 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label)
}
if (label->append)
- strncpy(bootargs, label->append, sizeof(bootargs));
+ strlcpy(bootargs, label->append, sizeof(bootargs));
strcat(bootargs, ip_str);
strcat(bootargs, mac_str);
--
2.43.0
More information about the U-Boot
mailing list