summaryrefslogtreecommitdiff
path: root/usr.sbin/rbootd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-29 18:39:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-29 18:39:01 +0000
commitda4b035c00c91f83f53006859ff51cc6316c59fd (patch)
tree5b71ada85fe1e39d042db8b6a28ab5ba06a71408 /usr.sbin/rbootd
parent8852a4e96620349bdbb8b1910914433eb4ae5b23 (diff)
more strlcat and strlcpy
Diffstat (limited to 'usr.sbin/rbootd')
-rw-r--r--usr.sbin/rbootd/bpf.c6
-rw-r--r--usr.sbin/rbootd/utils.c9
2 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/rbootd/bpf.c b/usr.sbin/rbootd/bpf.c
index a0c6f7aad9a..f016ed12090 100644
--- a/usr.sbin/rbootd/bpf.c
+++ b/usr.sbin/rbootd/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.9 2002/05/29 09:45:08 deraadt Exp $ */
+/* $OpenBSD: bpf.c,v 1.10 2002/05/29 18:39:00 deraadt Exp $ */
/* $NetBSD: bpf.c,v 1.5.2.1 1995/11/14 08:45:42 thorpej Exp $ */
/*
@@ -49,7 +49,7 @@
#ifndef lint
/*static char sccsid[] = "@(#)bpf.c 8.1 (Berkeley) 6/4/93";*/
-static char rcsid[] = "$OpenBSD: bpf.c,v 1.9 2002/05/29 09:45:08 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: bpf.c,v 1.10 2002/05/29 18:39:00 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -297,7 +297,7 @@ BpfGetIntfName(errmsg)
return(NULL);
}
- (void) strcpy(device, mp->ifr_name);
+ (void) strlcpy(device, mp->ifr_name, sizeof device);
return(device);
}
diff --git a/usr.sbin/rbootd/utils.c b/usr.sbin/rbootd/utils.c
index ad8c0d14c18..327073f7e45 100644
--- a/usr.sbin/rbootd/utils.c
+++ b/usr.sbin/rbootd/utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utils.c,v 1.5 2002/03/14 16:44:25 mpech Exp $ */
+/* $OpenBSD: utils.c,v 1.6 2002/05/29 18:39:00 deraadt Exp $ */
/* $NetBSD: utils.c,v 1.5.2.1 1995/11/14 08:45:46 thorpej Exp $ */
/*
@@ -49,7 +49,7 @@
#ifndef lint
/*static char sccsid[] = "@(#)utils.c 8.1 (Berkeley) 6/4/93";*/
-static char rcsid[] = "$OpenBSD: utils.c,v 1.5 2002/03/14 16:44:25 mpech Exp $";
+static char rcsid[] = "$OpenBSD: utils.c,v 1.6 2002/05/29 18:39:00 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -338,12 +338,11 @@ NewStr(str)
{
char *stmp;
- if ((stmp = (char *)malloc((unsigned) (strlen(str)+1))) == NULL) {
+ stmp = strdup(str);
+ if (stmp == NULL) {
syslog(LOG_ERR, "NewStr: out of memory (%s)", str);
return(NULL);
}
-
- (void) strcpy(stmp, str);
return(stmp);
}