[openssh-commits] [openssh] 01/01: fixed test in OSX closefrom() replacement
git+noreply at mindrot.org
git+noreply at mindrot.org
Mon Sep 2 10:29:21 AEST 2019
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
commit 368f1cc2fbd6ad10c66bc1b67c2c04aebf8a04a8
Author: Damien Miller <djm at mindrot.org>
Date: Mon Sep 2 10:28:42 2019 +1000
fixed test in OSX closefrom() replacement
from likan_999.student AT sina.com
---
openbsd-compat/bsd-closefrom.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c
index 8b9a5627..8fadca2d 100644
--- a/openbsd-compat/bsd-closefrom.c
+++ b/openbsd-compat/bsd-closefrom.c
@@ -107,9 +107,9 @@ closefrom(int lowfd)
if ((fdinfo_buf = malloc(sz)) == NULL)
goto fallback;
r = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, fdinfo_buf, sz);
- if (r < 0 || r >= sz)
+ if (r < 0 || r > sz)
goto fallback;
- for (i = 0; i < sz / (int)PROC_PIDLISTFD_SIZE; i++) {
+ for (i = 0; i < r / (int)PROC_PIDLISTFD_SIZE; i++) {
if (fdinfo_buf[i].proc_fd >= lowfd)
close(fdinfo_buf[i].proc_fd);
}
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list