From 92ee1f5e1060ab059c3f0e47f8ff369981026739 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 14 Dec 2023 21:19:08 -0700 Subject: [PATCH] pxe: Use strlcpy() instead of strcpy() in label_boot() The intention here is to nul-terminate the result string, so use the correct function for that. 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 a92bb896c6..2c87aba7ed 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -593,7 +593,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.39.5