diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-01-30 07:20:57 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-01-30 18:22:34 +1100 |
commit | 65d6fd0a8a6f31c3ddf0c1192429a176575cf701 (patch) | |
tree | 2274753633e4c7c10c58c293598ad661fb4b211b | |
parent | dce74eab0c0f9010dc84c62500a17771d0131ff3 (diff) |
upstream: check the return value of ssh_packet_write_poll() and
call sshpkt_fatal() if it fails; avoid potential busy-loop under some
circumstances. Based on patch by Mike Frysinger; ok dtucker@
OpenBSD-Commit-ID: c79fe5cf4f0cd8074cb6db257c1394d5139408ec
-rw-r--r-- | clientloop.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clientloop.c b/clientloop.c index 170155442..2590962b1 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.337 2020/01/29 08:17:49 djm Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.338 2020/01/30 07:20:57 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 |
@@ -1392,8 +1392,12 @@ client_loop(struct ssh *ssh, int have_pty, int escape_char_arg, | |||
1392 | * Send as much buffered packet data as possible to the | 1392 | * Send as much buffered packet data as possible to the |
1393 | * sender. | 1393 | * sender. |
1394 | */ | 1394 | */ |
1395 | if (FD_ISSET(connection_out, writeset)) | 1395 | if (FD_ISSET(connection_out, writeset)) { |
1396 | ssh_packet_write_poll(ssh); | 1396 | if ((r = ssh_packet_write_poll(ssh)) != 0) { |
1397 | sshpkt_fatal(ssh, r, | ||
1398 | "%s: ssh_packet_write_poll", __func__); | ||
1399 | } | ||
1400 | } | ||
1397 | 1401 | ||
1398 | /* | 1402 | /* |
1399 | * If we are a backgrounded control master, and the | 1403 | * If we are a backgrounded control master, and the |