From: Azat Khuzhin Date: Sat, 18 Sep 2021 21:39:30 +0000 (+0300) Subject: bufferevent_ssl: check return value of the evbuffer_drain() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41b5ab0f495b084e8cf25371642eb23f22bcf028;p=libevent bufferevent_ssl: check return value of the evbuffer_drain() Refs: #1163 --- diff --git a/bufferevent_ssl.c b/bufferevent_ssl.c index a946c162..837b84c4 100644 --- a/bufferevent_ssl.c +++ b/bufferevent_ssl.c @@ -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);