From 41b5ab0f495b084e8cf25371642eb23f22bcf028 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 19 Sep 2021 00:39:30 +0300 Subject: [PATCH] bufferevent_ssl: check return value of the evbuffer_drain() Refs: #1163 --- bufferevent_ssl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);