From 1a70173d7f1e3ac1e9bf678bd602537a06e0f406 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 25 Aug 2020 20:09:04 +0200
Subject: [PATCH] ssl_send_data(): Prevent endless loop

... if BIO_write() consistently returns 0.

Sponsored by: Robert Klemme
---
 openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openssl.c b/openssl.c
index 3125021f..6cc2af55 100644
--- 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))
          {
-- 
2.49.0