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.
This commit is contained in:
Joakim Soderberg
2013-02-05 11:10:23 +00:00
parent f4f13371f9
commit 834ebe5bd8

View File

@ -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;
}