]> granicus.if.org Git - libevent/commitdiff
Fix a segfault when writing a very fragmented evbuffer onto an SSL
authorJoachim Bauch <jojo@struktur.de>
Thu, 17 Dec 2009 17:38:46 +0000 (12:38 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 17 Dec 2009 17:38:46 +0000 (12:38 -0500)
Fixes bug 2916328.

bufferevent_openssl.c

index 7644886b22437f29613ee633408bced6184a7de4..c44fca30a99bd92b588b6c595c5e22fb7385f149 100644 (file)
@@ -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);