From a635784ab8adb7a7d4021b0af3c80fdbdbaea47d Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 29 May 2002 18:53:16 +0000 Subject: strlcat bounds --- lib/libc/rpc/clnt_perror.c | 4 ++-- lib/libskey/skeysubr.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c index 70b82973a78..0dc8d83ff16 100644 --- a/lib/libc/rpc/clnt_perror.c +++ b/lib/libc/rpc/clnt_perror.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: clnt_perror.c,v 1.13 2001/09/15 13:51:00 deraadt Exp $"; +static char *rcsid = "$OpenBSD: clnt_perror.c,v 1.14 2002/05/29 18:53:14 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -139,7 +139,7 @@ clnt_sperror(rpch, s) break; } strstart[CLNT_PERROR_BUFLEN-2] = '\0'; - strcat(strstart, "\n"); + strlcat(strstart, "\n", CLNT_PERROR_BUFLEN); return (strstart); truncated: diff --git a/lib/libskey/skeysubr.c b/lib/libskey/skeysubr.c index 4b705209a4a..1b9cce1980a 100644 --- a/lib/libskey/skeysubr.c +++ b/lib/libskey/skeysubr.c @@ -9,7 +9,7 @@ * * S/Key misc routines. * - * $OpenBSD: skeysubr.c,v 1.24 2002/05/24 21:33:09 deraadt Exp $ + * $OpenBSD: skeysubr.c,v 1.25 2002/05/29 18:53:15 deraadt Exp $ */ #include @@ -94,7 +94,7 @@ keycrunch_md4(result, seed, passwd) return(-1); (void)strlcpy(buf, seed, buflen + 1); lowcase(buf); - (void)strcat(buf, passwd); + (void)strlcat(buf, passwd, buflen + 1); sevenbit(buf); } else { buf = result; @@ -139,7 +139,7 @@ keycrunch_md5(result, seed, passwd) return(-1); (void)strlcpy(buf, seed, buflen + 1); lowcase(buf); - (void)strcat(buf, passwd); + (void)strlcat(buf, passwd, buflen + 1); sevenbit(buf); } else { buf = result; @@ -184,7 +184,7 @@ keycrunch_sha1(result, seed, passwd) return(-1); (void)strlcpy(buf, seed, buflen + 1); lowcase(buf); - (void)strcat(buf, passwd); + (void)strlcat(buf, passwd, buflen + 1); sevenbit(buf); } else { buf = result; @@ -240,7 +240,7 @@ keycrunch_rmd160(result, seed, passwd) return(-1); (void)strlcpy(buf, seed, buflen + 1); lowcase(buf); - (void)strcat(buf, passwd); + (void)strlcat(buf, passwd, buflen + 1); sevenbit(buf); } else { buf = result; -- cgit v1.2.3