From 9456161d39067db41c74cfd10186fed54b537e2d Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 24 May 2002 21:33:10 +0000 Subject: replace strcpy with strlcpy --- lib/libskey/skeysubr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/libskey/skeysubr.c') diff --git a/lib/libskey/skeysubr.c b/lib/libskey/skeysubr.c index 97b3f43e9e5..4b705209a4a 100644 --- a/lib/libskey/skeysubr.c +++ b/lib/libskey/skeysubr.c @@ -9,7 +9,7 @@ * * S/Key misc routines. * - * $OpenBSD: skeysubr.c,v 1.23 2002/02/16 21:27:28 millert Exp $ + * $OpenBSD: skeysubr.c,v 1.24 2002/05/24 21:33:09 deraadt Exp $ */ #include @@ -92,7 +92,7 @@ keycrunch_md4(result, seed, passwd) buflen = strlen(seed) + strlen(passwd); if ((buf = (char *)malloc(buflen + 1)) == NULL) return(-1); - (void)strcpy(buf, seed); + (void)strlcpy(buf, seed, buflen + 1); lowcase(buf); (void)strcat(buf, passwd); sevenbit(buf); @@ -137,7 +137,7 @@ keycrunch_md5(result, seed, passwd) buflen = strlen(seed) + strlen(passwd); if ((buf = (char *)malloc(buflen + 1)) == NULL) return(-1); - (void)strcpy(buf, seed); + (void)strlcpy(buf, seed, buflen + 1); lowcase(buf); (void)strcat(buf, passwd); sevenbit(buf); @@ -182,7 +182,7 @@ keycrunch_sha1(result, seed, passwd) buflen = strlen(seed) + strlen(passwd); if ((buf = (char *)malloc(buflen + 1)) == NULL) return(-1); - (void)strcpy(buf, seed); + (void)strlcpy(buf, seed, buflen + 1); lowcase(buf); (void)strcat(buf, passwd); sevenbit(buf); @@ -238,7 +238,7 @@ keycrunch_rmd160(result, seed, passwd) buflen = strlen(seed) + strlen(passwd); if ((buf = (char *)malloc(buflen + 1)) == NULL) return(-1); - (void)strcpy(buf, seed); + (void)strlcpy(buf, seed, buflen + 1); lowcase(buf); (void)strcat(buf, passwd); sevenbit(buf); -- cgit v1.2.3