aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2017-07-05 06:12:21 +0000
committerXin LI <delphij@FreeBSD.org>2017-07-05 06:12:21 +0000
commit2bbd226f5aa0e895cea8502fc7d0f642f927ad82 (patch)
tree88633c48b3bae64760332071e03d6bbe6e254c70 /libexec
parente7df11b86968bea6043321addc3a4e2ac86a331c (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 5d77b9cc0f7d..ea3cacb2a73d 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -5300,14 +5300,14 @@ open_binary_fd(const char *argv0, bool search_in_path)
fd = -1;
errno = ENOENT;
while ((pe = strsep(&pathenv, ":")) != NULL) {
- if (strlcpy(binpath, pe, sizeof(binpath)) >
+ if (strlcpy(binpath, pe, sizeof(binpath)) >=
sizeof(binpath))
continue;
if (binpath[0] != '\0' &&
- strlcat(binpath, "/", sizeof(binpath)) >
+ strlcat(binpath, "/", sizeof(binpath)) >=
sizeof(binpath))
continue;
- if (strlcat(binpath, argv0, sizeof(binpath)) >
+ if (strlcat(binpath, argv0, sizeof(binpath)) >=
sizeof(binpath))
continue;
fd = open(binpath, O_RDONLY | O_CLOEXEC | O_VERIFY);