diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-11-09 18:59:24 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-11-09 18:59:24 +0000 |
commit | 074cf44a8748a6d4bce702e5e8868afba73110a5 (patch) | |
tree | 8d6f94995ff3d9de4cdbdfbdef7e4c726865294b /usr.bin/ssh | |
parent | 8d75a6bc2081cf4f7f067b438002ced66e354f8f (diff) |
don't memset too much memory, ok millert@
original patch from jlk@kamens.brookline.ma.us via nalin@redhat.com
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/clientloop.c | 10 | ||||
-rw-r--r-- | usr.bin/ssh/serverloop.c | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index e8cd49988f5..cbcb1d1998a 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.86 2001/10/24 19:57:40 markus Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.87 2001/11/09 18:59:23 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -346,8 +346,8 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, if (session_closed && !channel_still_open() && !packet_have_data_to_write()) { /* clear mask since we did not call select() */ - memset(*readsetp, 0, *maxfdp); - memset(*writesetp, 0, *maxfdp); + memset(*readsetp, 0, *nallocp); + memset(*writesetp, 0, *nallocp); return; } else { FD_SET(connection_in, *readsetp); @@ -375,8 +375,8 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, * We have to return, because the mainloop checks for the flags * set by the signal handlers. */ - memset(*readsetp, 0, *maxfdp); - memset(*writesetp, 0, *maxfdp); + memset(*readsetp, 0, *nallocp); + memset(*writesetp, 0, *nallocp); if (errno == EINTR) return; diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c index 5976d51df1e..39f19e1ddcd 100644 --- a/usr.bin/ssh/serverloop.c +++ b/usr.bin/ssh/serverloop.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: serverloop.c,v 1.82 2001/10/10 22:18:47 markus Exp $"); +RCSID("$OpenBSD: serverloop.c,v 1.83 2001/11/09 18:59:23 markus Exp $"); #include "xmalloc.h" #include "packet.h" @@ -272,8 +272,8 @@ wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, int *maxfdp, ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp); if (ret == -1) { - memset(*readsetp, 0, *maxfdp); - memset(*writesetp, 0, *maxfdp); + memset(*readsetp, 0, *nallocp); + memset(*writesetp, 0, *nallocp); if (errno != EINTR) error("select: %.100s", strerror(errno)); } else if (ret == 0 && client_alive_scheduled) |