]> granicus.if.org Git - libevent/commitdiff
bufferevent_ssl: check return value of the evbuffer_drain()
authorAzat Khuzhin <azat@libevent.org>
Sat, 18 Sep 2021 21:39:30 +0000 (00:39 +0300)
committerAzat Khuzhin <azat@libevent.org>
Sat, 18 Sep 2021 21:39:54 +0000 (00:39 +0300)
Refs: #1163

bufferevent_ssl.c

index a946c162f9d76f166b3230584b8a31a603caedbf..837b84c45f3ad8c2640c88364a48847c98dfe9a7 100644 (file)
@@ -385,7 +385,9 @@ do_write(struct bufferevent_ssl *bev_ssl, int atmost)
                }
        }
        if (n_written) {
-               evbuffer_drain(output, n_written);
+               if (evbuffer_drain(output, n_written))
+                       return OP_ERR | result;
+
                if (bev_ssl->underlying)
                        BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);