Module Name: src Committed By: joerg Date: Fri Oct 7 10:42:54 UTC 2011
Modified Files: src/dist/pppd/pppd: auth.c Log Message: Simplify. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/dist/pppd/pppd/auth.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/dist/pppd/pppd/auth.c diff -u src/dist/pppd/pppd/auth.c:1.7 src/dist/pppd/pppd/auth.c:1.8 --- src/dist/pppd/pppd/auth.c:1.7 Sun Nov 5 09:16:20 2006 +++ src/dist/pppd/pppd/auth.c Fri Oct 7 10:42:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: auth.c,v 1.7 2006/11/05 09:16:20 martin Exp $ */ +/* $NetBSD: auth.c,v 1.8 2011/10/07 10:42:54 joerg Exp $ */ /* * auth.c - PPP authentication and phase control. @@ -75,7 +75,7 @@ #if 0 #define RCSID "Id: auth.c,v 1.112 2006/06/18 11:26:00 paulus Exp" #else -__RCSID("$NetBSD: auth.c,v 1.7 2006/11/05 09:16:20 martin Exp $"); +__RCSID("$NetBSD: auth.c,v 1.8 2011/10/07 10:42:54 joerg Exp $"); #endif #endif @@ -2459,14 +2459,15 @@ scan_authfile(f, client, server, secret, */ app = &alist; for (;;) { + size_t len; if (!getword(f, word, &newline, filename) || newline) break; - ap = (struct wordlist *) - malloc(sizeof(struct wordlist) + strlen(word) + 1); + len = strlen(word) + 1; + ap = (struct wordlist *)malloc(sizeof(struct wordlist) + len); if (ap == NULL) novm("authorized addresses"); ap->word = (char *) (ap + 1); - strlcpy(ap->word, word, strlen(word) + 1); + memcpy(ap->word, word, len); *app = ap; app = &ap->next; }