summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/stand
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-11 19:41:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-11 19:41:13 +0000
commitd6d7c738346239a3c708dc0978911e106ff464ef (patch)
treebc43e8e3f9316ebb64d8b2b82353eeccf749cf26 /sys/arch/alpha/stand
parent0b07ddfee5e2e357a1085b59936307292adeacfe (diff)
string cleaning; krw ok
Diffstat (limited to 'sys/arch/alpha/stand')
-rw-r--r--sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c b/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
index 114a7556f11..02381d36ff0 100644
--- a/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
+++ b/sys/arch/alpha/stand/setnetbootinfo/setnetbootinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: setnetbootinfo.c,v 1.1 1997/05/05 06:02:03 millert Exp $ */
+/* $OpenBSD: setnetbootinfo.c,v 1.2 2003/05/11 19:41:09 deraadt Exp $ */
/* $NetBSD: setnetbootinfo.c,v 1.5 1997/04/06 08:41:37 cgd Exp $ */
/*
@@ -140,10 +140,13 @@ main(argc, argv)
outfilename = outfile;
else {
/* name + 12 for enet addr + '.' before enet addr + NUL */
- outfilename = malloc(strlen(netboot) + 14);
+ size_t len = strlen(netboot) + 14;
+
+ outfilename = malloc(len);
if (outfilename == NULL)
err(1, "malloc of output file name failed");
- sprintf(outfilename, "%s.%02x%02x%02x%02x%02x%02x", netboot,
+ snprintf(outfilename, len,
+ "%s.%02x%02x%02x%02x%02x%02x", netboot,
ether_addr->ether_addr_octet[0],
ether_addr->ether_addr_octet[1],
ether_addr->ether_addr_octet[2],