summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/realpath.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-05-24 21:22:37 +0000
committerderaadt <deraadt@openbsd.org>2002-05-24 21:22:37 +0000
commit5af14704cf583f2bdbbe00069ed34254a82d104f (patch)
tree2e7b4fc407290059fd5e1ddb505637dcf41046e2 /lib/libc/stdlib/realpath.c
parentReplace strcpy() with strlcpy(). (diff)
downloadwireguard-openbsd-5af14704cf583f2bdbbe00069ed34254a82d104f.tar.xz
wireguard-openbsd-5af14704cf583f2bdbbe00069ed34254a82d104f.zip
try to use strlcpy and snprintf more; ok various
Diffstat (limited to 'lib/libc/stdlib/realpath.c')
-rw-r--r--lib/libc/stdlib/realpath.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c
index 061f1a7ef12..d01b19e0f2e 100644
--- a/lib/libc/stdlib/realpath.c
+++ b/lib/libc/stdlib/realpath.c
@@ -35,7 +35,7 @@
*/
#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>
@@ -66,7 +66,7 @@ realpath(path, resolved)
/* Save the starting point. */
if ((fd = open(".", O_RDONLY)) < 0) {
- (void)strcpy(resolved, ".");
+ (void)strlcpy(resolved, ".", MAXPATHLEN);
return (NULL);
}
@@ -125,7 +125,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;