cyassl/cyassl — pull request #23 by JoakimSoderberg (2013-02-05 11:25:23+00:00)
Title: BUGFIX: Segmentation fault on CyaSSL_BIO_free() when using CyaSSL_BIO_new_socket()

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.

Related code:
https://github.com/cyassl/cyassl/blob/master/src/ssl.c#L4001-L4017
https://github.com/cyassl/cyassl/blob/master/src/ssl.c#L4112-L4113