summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-09-21 04:31:00 +0000
committerDamien Miller <djm@mindrot.org>2015-09-21 14:33:42 +1000
commit8408218c1ca88cb17d15278174a24a94a6f65fe1 (patch)
tree56082a24225248cf68231a39f885dd567ce916cd /packet.c
parent0097248f90a00865082e8c146b905a6555cc146f (diff)
upstream commit
fix possible hang on closed output; bz#2469 reported by Tomas Kuthan ok markus@ Upstream-ID: f7afd41810f8540f524284f1be6b970859f94fe3
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/packet.c b/packet.c
index 01d3e2970..9cf09e201 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.214 2015/08/20 22:32:42 deraadt Exp $ */ 1/* $OpenBSD: packet.c,v 1.215 2015/09/21 04:31:00 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2040,7 +2040,8 @@ ssh_packet_write_wait(struct ssh *ssh)
2040 NFDBITS), sizeof(fd_mask)); 2040 NFDBITS), sizeof(fd_mask));
2041 if (setp == NULL) 2041 if (setp == NULL)
2042 return SSH_ERR_ALLOC_FAIL; 2042 return SSH_ERR_ALLOC_FAIL;
2043 ssh_packet_write_poll(ssh); 2043 if ((r = ssh_packet_write_poll(ssh)) != 0)
2044 return r;
2044 while (ssh_packet_have_data_to_write(ssh)) { 2045 while (ssh_packet_have_data_to_write(ssh)) {
2045 memset(setp, 0, howmany(state->connection_out + 1, 2046 memset(setp, 0, howmany(state->connection_out + 1,
2046 NFDBITS) * sizeof(fd_mask)); 2047 NFDBITS) * sizeof(fd_mask));