summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bind/lib/isc/unix/dir.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2003-05-08 22:34:45 +0000
committertedu <tedu@openbsd.org>2003-05-08 22:34:45 +0000
commit51bfa0a4b30bf756c691f84e18319e515cd495b3 (patch)
tree9cd0c72c3a34fc1077991d297c9ecc5c90462edb /usr.sbin/bind/lib/isc/unix/dir.c
parentClose sockets (otherwise the file handle limit can be reached when many (diff)
downloadwireguard-openbsd-51bfa0a4b30bf756c691f84e18319e515cd495b3.tar.xz
wireguard-openbsd-51bfa0a4b30bf756c691f84e18319e515cd495b3.zip
replace strcpy with strlcpy and some strdup.
ok rohee@ tdeval@ dhartmei@ requested by deraadt@
Diffstat (limited to 'usr.sbin/bind/lib/isc/unix/dir.c')
-rw-r--r--usr.sbin/bind/lib/isc/unix/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bind/lib/isc/unix/dir.c b/usr.sbin/bind/lib/isc/unix/dir.c
index 211ce0393d0..f40ab1ba653 100644
--- a/usr.sbin/bind/lib/isc/unix/dir.c
+++ b/usr.sbin/bind/lib/isc/unix/dir.c
@@ -97,7 +97,7 @@ isc_dir_read(isc_dir_t *dir) {
if (sizeof(dir->entry.name) <= strlen(entry->d_name))
return (ISC_R_UNEXPECTED);
- strcpy(dir->entry.name, entry->d_name);
+ strlcpy(dir->entry.name, entry->d_name, sizeof(dir->entry.name));
/*
* Some dirents have d_namlen, but it is not portable.
@@ -177,7 +177,7 @@ isc_dir_current(char *dirname, size_t length, isc_boolean_t end_sep) {
if (strlen(dirname) + 1 == length)
result = ISC_R_NOSPACE;
else if (dirname[1] != '\0')
- strcat(dirname, "/");
+ strlcat(dirname, "/", length);
}
return (result);