summaryrefslogtreecommitdiffstats
path: root/libexec/bootpd
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1997-12-24 18:56:03 +0000
committerimp <imp@FreeBSD.org>1997-12-24 18:56:03 +0000
commit604bcde61e03e4ca051aae2c87b0f250a3806280 (patch)
tree1ef9d5908599dfec43502dee23a1b807123cb4dd /libexec/bootpd
parentd97fabbb53b5ec9256c2d5ae44081162784d35d7 (diff)
downloadFreeBSD-src-604bcde61e03e4ca051aae2c87b0f250a3806280.zip
FreeBSD-src-604bcde61e03e4ca051aae2c87b0f250a3806280.tar.gz
Use snprintf rather than printf out of paranoia
Obtained from: OpenBSD
Diffstat (limited to 'libexec/bootpd')
-rw-r--r--libexec/bootpd/getether.c4
-rw-r--r--libexec/bootpd/hwaddr.c4
-rw-r--r--libexec/bootpd/readfile.c5
-rw-r--r--libexec/bootpd/report.c2
-rw-r--r--libexec/bootpd/tools/bootptest/bootptest.c4
5 files changed, 10 insertions, 9 deletions
diff --git a/libexec/bootpd/getether.c b/libexec/bootpd/getether.c
index cf01b03..8f31bcb 100644
--- a/libexec/bootpd/getether.c
+++ b/libexec/bootpd/getether.c
@@ -7,7 +7,7 @@
* If you figure out how to do this on another system,
* please let me know. <gwr@mc.com>
*
- * $Id$
+ * $Id: getether.c,v 1.7 1997/02/22 14:21:05 peter Exp $
*/
#include <sys/types.h>
@@ -195,7 +195,7 @@ getether(ifname, eap)
char *enaddr;
int unit = -1; /* which unit to attach */
- sprintf(devname, "/dev/%s", ifname);
+ snprintf(devname, sizeof(devname), "/dev/%s", ifname);
fd = open(devname, 2);
if (fd < 0) {
/* Try without the trailing digit. */
diff --git a/libexec/bootpd/hwaddr.c b/libexec/bootpd/hwaddr.c
index bc41cff..b4fe5e4 100644
--- a/libexec/bootpd/hwaddr.c
+++ b/libexec/bootpd/hwaddr.c
@@ -2,7 +2,7 @@
* hwaddr.c - routines that deal with hardware addresses.
* (i.e. Ethernet)
*
- * $Id$
+ * $Id: hwaddr.c,v 1.5 1997/02/22 14:21:07 peter Exp $
*/
#include <sys/types.h>
@@ -198,7 +198,7 @@ setarp(s, ia, hafamily, haddr, halen)
extern char *inet_ntoa();
a = inet_ntoa(*ia);
- sprintf(buf, "arp -d %s; arp -s %s %s temp",
+ snprintf(buf, sizeof(buf), "arp -d %s; arp -s %s %s temp",
a, a, haddrtoa(haddr, halen));
if (debug > 2)
report(LOG_INFO, buf);
diff --git a/libexec/bootpd/readfile.c b/libexec/bootpd/readfile.c
index 8dfd430..8d895fd 100644
--- a/libexec/bootpd/readfile.c
+++ b/libexec/bootpd/readfile.c
@@ -19,7 +19,7 @@ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
- $Id$
+ $Id: readfile.c,v 1.4 1997/02/22 14:21:09 peter Exp $
************************************************************************/
@@ -817,7 +817,8 @@ eval_symbol(symbol, hp)
if ((*symbol)[0] == 'T') { /* generic symbol */
(*symbol)++;
value = get_u_long(symbol);
- sprintf(current_tagname, "T%d", (int)value);
+ snprintf(current_tagname, sizeof(current_tagname),
+ "T%d", (int)value);
eat_whitespace(symbol);
if ((*symbol)[0] != '=') {
return E_SYNTAX_ERROR;
diff --git a/libexec/bootpd/report.c b/libexec/bootpd/report.c
index 4f7f036..e754a30 100644
--- a/libexec/bootpd/report.c
+++ b/libexec/bootpd/report.c
@@ -111,7 +111,7 @@ report(priority, fmt, va_alist)
#else
va_start(ap);
#endif
- vsprintf(buf, fmt, ap);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
/*
diff --git a/libexec/bootpd/tools/bootptest/bootptest.c b/libexec/bootpd/tools/bootptest/bootptest.c
index 2e23112..92a3837 100644
--- a/libexec/bootpd/tools/bootptest/bootptest.c
+++ b/libexec/bootpd/tools/bootptest/bootptest.c
@@ -31,7 +31,7 @@
* 09/28/93 Released version 1.0
* 09/93 Original developed by Gordon W. Ross <gwr@mc.com>
*
- * $Id$
+ * $Id: bootptest.c,v 1.4 1997/02/22 14:21:20 peter Exp $
*/
char *usage = "bootptest [-h] server-name [vendor-data-template-file]";
@@ -503,7 +503,7 @@ ipaddr_string(ina)
u_char *p;
p = (u_char *) ina;
- sprintf(b, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
+ snprintf(b, sizeof(b), "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
return (b);
}
OpenPOWER on IntegriCloud