diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-09-08 04:30:20 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-09-08 04:30:20 +0000 |
commit | 3bb43b8d159d25ed6cd3149a51721f6666e963ed (patch) | |
tree | 755232868a2c17a2520e09da470a587e38430a77 /libexec/getty | |
parent | 3e6aaa86f1292cc61403bfcf6fb41702ef5681a4 (diff) |
Convert this strncat() to strlcat() and avoid one-byte oflow; millert@ ok
Diffstat (limited to 'libexec/getty')
-rw-r--r-- | libexec/getty/subr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c index 0c0fd3a2f51..dcae48d064d 100644 --- a/libexec/getty/subr.c +++ b/libexec/getty/subr.c @@ -33,7 +33,7 @@ #ifndef lint /*static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";*/ -static char rcsid[] = "$Id: subr.c,v 1.8 1997/04/06 08:43:44 deraadt Exp $"; +static char rcsid[] = "$Id: subr.c,v 1.9 2000/09/08 04:30:19 aaron Exp $"; #endif /* not lint */ /* @@ -617,8 +617,7 @@ makeenv(env) ep = env; if (TT && *TT) { - strncat(termbuf, TT, sizeof(termbuf)-strlen(termbuf)); - termbuf[sizeof(termbuf)-1] = '\0'; + strlcat(termbuf, TT, sizeof(termbuf)); *ep++ = termbuf; } if ((p = EV)) { |