From: Joachim Bauch Date: Thu, 17 Dec 2009 17:38:46 +0000 (-0500) Subject: Fix a segfault when writing a very fragmented evbuffer onto an SSL X-Git-Tag: release-2.0.4-alpha~119 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6adeca72ccf1202c013001136d6e3ee3ddc0764;p=libevent Fix a segfault when writing a very fragmented evbuffer onto an SSL Fixes bug 2916328. --- diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index 7644886b..c44fca30 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -590,6 +590,8 @@ do_write(struct bufferevent_openssl *bev_ssl, int atmost) if (n < 0) return -1; + if (n > 8) + n = 8; for (i=0; i < n; ++i) { r = SSL_write(bev_ssl->ssl, space[i].iov_base, space[i].iov_len);