diff options
Diffstat (limited to 'crypto/openssh/openbsd-compat/realpath.c')
-rw-r--r-- | crypto/openssh/openbsd-compat/realpath.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/openssh/openbsd-compat/realpath.c b/crypto/openssh/openbsd-compat/realpath.c index b4a05db..b9035ca 100644 --- a/crypto/openssh/openbsd-compat/realpath.c +++ b/crypto/openssh/openbsd-compat/realpath.c @@ -32,7 +32,7 @@ #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: realpath.c,v 1.6 2002/01/12 16:24:35 millert Exp $"; +static char *rcsid = "$OpenBSD: realpath.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -69,7 +69,7 @@ realpath(const char *path, char *resolved) /* Save the starting point. */ getcwd(start,MAXPATHLEN); if ((fd = open(".", O_RDONLY)) < 0) { - (void)strcpy(resolved, "."); + (void)strlcpy(resolved, ".", MAXPATHLEN); return (NULL); } close(fd); @@ -129,7 +129,7 @@ loop: * Save the last component name and get the full pathname of * the current directory. */ - (void)strcpy(wbuf, p); + (void)strlcpy(wbuf, p, sizeof wbuf); if (getcwd(resolved, MAXPATHLEN) == 0) goto err1; |