diff options
author | bcook <> | 2014-07-10 08:59:15 +0000 |
---|---|---|
committer | bcook <> | 2014-07-10 08:59:15 +0000 |
commit | e166fd2863721cf76df04cb700440ba75c838213 (patch) | |
tree | 0ee9df7256517d7eb2a6de3b97f16cab4be864a0 /src | |
parent | 0b1bfa3ad2401aca3c52a5274b6ce2bf4d442075 (diff) | |
download | openbsd-e166fd2863721cf76df04cb700440ba75c838213.tar.gz openbsd-e166fd2863721cf76df04cb700440ba75c838213.tar.bz2 openbsd-e166fd2863721cf76df04cb700440ba75c838213.zip |
check return value of write.
ok beck@ jsing@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/src/apps/s_server.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c index 1c13d5517d..45c4f5fa9c 100644 --- a/src/lib/libssl/src/apps/s_server.c +++ b/src/lib/libssl/src/apps/s_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_server.c,v 1.56 2014/07/09 21:02:35 tedu Exp $ */ | 1 | /* $OpenBSD: s_server.c,v 1.57 2014/07/10 08:59:15 bcook Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1709,9 +1709,20 @@ sv_body(char *hostname, int s, unsigned char *context) | |||
1709 | again: | 1709 | again: |
1710 | i = SSL_read(con, (char *) buf, bufsize); | 1710 | i = SSL_read(con, (char *) buf, bufsize); |
1711 | switch (SSL_get_error(con, i)) { | 1711 | switch (SSL_get_error(con, i)) { |
1712 | case SSL_ERROR_NONE: | 1712 | case SSL_ERROR_NONE: { |
1713 | write(fileno(stdout), buf, | 1713 | int len, n; |
1714 | (unsigned int) i); | 1714 | for (len = 0; len < i;) { |
1715 | do { | ||
1716 | n = write(fileno(stdout), buf + len, i - len); | ||
1717 | } while (n == -1 && errno == EINTR); | ||
1718 | |||
1719 | if (n < 0) { | ||
1720 | BIO_printf(bio_s_out, "ERROR\n"); | ||
1721 | goto err; | ||
1722 | } | ||
1723 | len += n; | ||
1724 | } | ||
1725 | } | ||
1715 | if (SSL_pending(con)) | 1726 | if (SSL_pending(con)) |
1716 | goto again; | 1727 | goto again; |
1717 | break; | 1728 | break; |