summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sftp-server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sftp-server.c b/sftp-server.c
index eac11d7e6..62e76a505 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-server.c,v 1.107 2015/08/20 22:32:42 deraadt Exp $ */ 1/* $OpenBSD: sftp-server.c,v 1.108 2015/11/16 06:13:04 logan Exp $ */
2/* 2/*
3 * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
4 * 4 *
@@ -1631,9 +1631,8 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw)
1631 if ((oqueue = sshbuf_new()) == NULL) 1631 if ((oqueue = sshbuf_new()) == NULL)
1632 fatal("%s: sshbuf_new failed", __func__); 1632 fatal("%s: sshbuf_new failed", __func__);
1633 1633
1634 set_size = howmany(max + 1, NFDBITS) * sizeof(fd_mask); 1634 rset = xcalloc(howmany(max + 1, NFDBITS), sizeof(fd_mask));
1635 rset = xmalloc(set_size); 1635 wset = xcalloc(howmany(max + 1, NFDBITS), sizeof(fd_mask));
1636 wset = xmalloc(set_size);
1637 1636
1638 if (homedir != NULL) { 1637 if (homedir != NULL) {
1639 if (chdir(homedir) != 0) { 1638 if (chdir(homedir) != 0) {
@@ -1642,6 +1641,7 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw)
1642 } 1641 }
1643 } 1642 }
1644 1643
1644 set_size = howmany(max + 1, NFDBITS) * sizeof(fd_mask);
1645 for (;;) { 1645 for (;;) {
1646 memset(rset, 0, set_size); 1646 memset(rset, 0, set_size);
1647 memset(wset, 0, set_size); 1647 memset(wset, 0, set_size);