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