diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2015-09-21 04:31:01 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2015-09-21 04:31:01 +0000 |
commit | ee30ec5e8ba8e2b607c372529c4523d860f31c25 (patch) | |
tree | 7427f01dc687ddab98f9a7434e2ae52708c123b4 /usr.bin/ssh/packet.c | |
parent | 009d4056740510d43e2d8d63c436c6da1989a917 (diff) |
fix possible hang on closed output; bz#2469 reported by Tomas Kuthan
ok markus@
Diffstat (limited to 'usr.bin/ssh/packet.c')
-rw-r--r-- | usr.bin/ssh/packet.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index 841a15a6834..110e0c3acb5 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.214 2015/08/20 22:32:42 deraadt Exp $ */ +/* $OpenBSD: packet.c,v 1.215 2015/09/21 04:31:00 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -2027,7 +2027,8 @@ ssh_packet_write_wait(struct ssh *ssh) NFDBITS), sizeof(fd_mask)); if (setp == NULL) return SSH_ERR_ALLOC_FAIL; - ssh_packet_write_poll(ssh); + if ((r = ssh_packet_write_poll(ssh)) != 0) + return r; while (ssh_packet_have_data_to_write(ssh)) { memset(setp, 0, howmany(state->connection_out + 1, NFDBITS) * sizeof(fd_mask)); |