summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bind/lib/isc/unix/file.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/file.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/file.c')
-rw-r--r--usr.sbin/bind/lib/isc/unix/file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bind/lib/isc/unix/file.c b/usr.sbin/bind/lib/isc/unix/file.c
index 1e3d96db95f..95f5428ca43 100644
--- a/usr.sbin/bind/lib/isc/unix/file.c
+++ b/usr.sbin/bind/lib/isc/unix/file.c
@@ -147,12 +147,12 @@ isc_file_template(const char *path, const char *templet, char *buf,
strncpy(buf, path, s - path + 1);
buf[s - path + 1] = '\0';
- strcat(buf, templet);
+ strlcat(buf, templet, buflen);
} else {
if ((strlen(templet) + 1) > buflen)
return (ISC_R_NOSPACE);
- strcpy(buf, templet);
+ strlcpy(buf, templet, buflen);
}
return (ISC_R_SUCCESS);
@@ -310,6 +310,6 @@ isc_file_absolutepath(const char *filename, char *path, size_t pathlen) {
return (result);
if (strlen(path) + strlen(filename) + 1 > pathlen)
return (ISC_R_NOSPACE);
- strcat(path, filename);
+ strlcat(path, filename, pathlen);
return (ISC_R_SUCCESS);
}