diff mbox series

[v3,09/46] boot: Use strlcpy() in label_boot()

Message ID 20241206023626.2456858-10-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series pxe: Support read_all() for extlinux and PXE | expand

Commit Message

Simon Glass Dec. 6, 2024, 2:35 a.m. UTC
This function is recommended instead of strncpy() since it always
terminates the string.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v2)

Changes in v2:
- Split out strlcpy() change into new patch

 boot/pxe_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Dec. 20, 2024, 4:06 a.m. UTC | #1
This function is recommended instead of strncpy() since it always
terminates the string.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v2)

Changes in v2:
- Split out strlcpy() change into new patch

 boot/pxe_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to sjg/master, thanks!
diff mbox series

Patch

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);