ssl_create_cipher_list: check whether push onto cipherstack succeeds

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Jonas Maebe 2013-12-02 22:04:47 +01:00 committed by Kurt Roeckx
parent b3b966fb87
commit f5905ba341

View File

@ -1621,7 +1621,12 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method,
if (curr->active)
#endif
{
sk_SSL_CIPHER_push(cipherstack, curr->cipher);
if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher))
{
OPENSSL_free(co_list);
sk_SSL_CIPHER_free(cipherstack);
return NULL;
}
#ifdef CIPHER_DEBUG
printf("<%s>\n",curr->cipher->name);
#endif