From 834ebe5bd84197fe70aa23f5cbbe55568202284e Mon Sep 17 00:00:00 2001 From: Joakim Soderberg Date: Tue, 5 Feb 2013 11:10:23 +0000 Subject: [PATCH] BUGFIX: Fixed segmentation fault on CyaSSL_BIO_free(). In CyaSSL_BIO_new_socket() bio->mem is never initialized. This will cause freeing of unallocated memory in CyaSSL_BIO_free: if (bio->mem) XFREE(bio->mem, 0, DYNAMIC_TYPE_OPENSSL); since bio->mem is not NULL, resulting in a crash. --- src/ssl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index 1c1338f30..7aeaaa4ae 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -4012,6 +4012,8 @@ int CyaSSL_set_compression(CYASSL* ssl) bio->fd = sfd; bio->prev = 0; bio->next = 0; + bio->mem = NULL; + bio->memLen = 0; } return bio; }