From: Simon Glass Date: Fri, 15 Dec 2023 04:19:08 +0000 (-0700) Subject: pxe: Use strlcpy() instead of strcpy() in label_boot() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=92ee1f5e1060ab059c3f0e47f8ff369981026739;p=u-boot.git 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 --- 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);