summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Jodeit <moritz@cvs.openbsd.org>2006-01-25 22:41:55 +0000
committerMoritz Jodeit <moritz@cvs.openbsd.org>2006-01-25 22:41:55 +0000
commitc3a3bbf91cbd1a22022e229332492e8573e212df (patch)
treeaaa7e532212bb9fedffc67d04b4716dec6544a3a
parent7f1b83b8597203014ba5ac1fa5048d42da45a0a3 (diff)
Fix an off-by-one in pppd(8)'s option handling. ok tedu@
-rw-r--r--usr.sbin/pppd/options.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pppd/options.c b/usr.sbin/pppd/options.c
index 6a110ad958e..0f10b642e2f 100644
--- a/usr.sbin/pppd/options.c
+++ b/usr.sbin/pppd/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.19 2003/04/04 20:25:07 deraadt Exp $ */
+/* $OpenBSD: options.c,v 1.20 2006/01/25 22:41:54 moritz Exp $ */
/*
* options.c - handles option processing for PPP.
@@ -46,7 +46,7 @@
#if 0
static char rcsid[] = "Id: options.c,v 1.42 1998/03/26 04:46:06 paulus Exp $";
#else
-static char rcsid[] = "$OpenBSD: options.c,v 1.19 2003/04/04 20:25:07 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: options.c,v 1.20 2006/01/25 22:41:54 moritz Exp $";
#endif
#endif
@@ -1587,8 +1587,8 @@ setdomain(argv)
gethostname(hostname, MAXNAMELEN);
if (**argv != 0) {
if (**argv != '.')
- strncat(hostname, ".", MAXNAMELEN - strlen(hostname));
- strncat(hostname, *argv, MAXNAMELEN - strlen(hostname));
+ strlcat(hostname, ".", MAXNAMELEN);
+ strlcat(hostname, *argv, MAXNAMELEN);
}
hostname[MAXNAMELEN-1] = 0;
return (1);