summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-16 01:39:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-16 01:39:28 +0000
commit078021ec13ea6203d9bdc46c5b9e98b5fa0f4863 (patch)
treeff96615d28f59986e79543df828f619df08080ef
parentd6fcd4a09507eb4b61f2ad4286aee872a8437a7f (diff)
string cleaning; ok millert
-rw-r--r--usr.sbin/pppd/auth.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/pppd/auth.c b/usr.sbin/pppd/auth.c
index 99b0a8c3ac3..7d1fda10148 100644
--- a/usr.sbin/pppd/auth.c
+++ b/usr.sbin/pppd/auth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth.c,v 1.27 2003/04/04 20:25:07 deraadt Exp $ */
+/* $OpenBSD: auth.c,v 1.28 2003/04/16 01:39:27 deraadt Exp $ */
/*
* auth.c - PPP authentication and phase control.
@@ -77,7 +77,7 @@
#if 0
static char rcsid[] = "Id: auth.c,v 1.37 1998/03/26 04:46:03 paulus Exp $";
#else
-static char rcsid[] = "$OpenBSD: auth.c,v 1.27 2003/04/04 20:25:07 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: auth.c,v 1.28 2003/04/16 01:39:27 deraadt Exp $";
#endif
#endif
@@ -1447,14 +1447,17 @@ scan_authfile(f, client, server, ipaddr, secret, addrs, filename)
*/
alist = alast = NULL;
for (;;) {
+ size_t wordlen;
+
if (!getword(f, word, &newline, filename) || newline)
break;
- ap = (struct wordlist *) malloc(sizeof(struct wordlist)
- + strlen(word));
+ wordlen = strlen(word); /* NUL in struct wordlist */
+ ap = (struct wordlist *) malloc(sizeof(struct wordlist) +
+
if (ap == NULL)
novm("authorized addresses");
ap->next = NULL;
- strcpy(ap->word, word);
+ strlcpy(ap->word, word, wordlen + 1);
if (alist == NULL)
alist = ap;
else