From 89f9271b17a0a2082da3c157c67df1bcd88ea700 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 5 Dec 2024 19:35:48 -0700 Subject: [PATCH] boot: Use strlcpy() in label_boot() This function is recommended instead of strncpy() since it always terminates the string. Signed-off-by: Simon Glass --- 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 82f217aaf86..e96935896a9 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -558,7 +558,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);