]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pxe: Use strlcpy() instead of strcpy() in label_boot()
authorSimon Glass <sjg@chromium.org>
Fri, 15 Dec 2023 04:19:08 +0000 (21:19 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 10 Apr 2024 23:04:25 +0000 (17:04 -0600)
The intention here is to nul-terminate the result string, so use the
correct function for that.

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/pxe_utils.c

index a92bb896c63e01ef00b805a6f7efcd671605c203..2c87aba7ed333cf1efff523c090b8246ce48f390 100644 (file)
@@ -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);