ssl_send_data(): Prevent endless loop
authorFabian Keil <fk@fabiankeil.de>
Tue, 25 Aug 2020 18:09:04 +0000 (20:09 +0200)
committerFabian Keil <fk@fabiankeil.de>
Tue, 1 Sep 2020 10:22:42 +0000 (12:22 +0200)
... if BIO_write() consistently returns 0.

Sponsored by: Robert Klemme

openssl.c

index 3125021..6cc2af5 100644 (file)
--- a/openssl.c
+++ b/openssl.c
@@ -171,7 +171,7 @@ extern int ssl_send_data(struct ssl_attr *ssl_attr, const unsigned char *buf, si
        */
       while ((ret = BIO_write(bio,
          (const unsigned char *)(buf + pos),
-         send_len)) < 0)
+         send_len)) <= 0)
       {
          if (!BIO_should_retry(bio))
          {