diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 0a2c04e7414098d6109abd67b780ac8651fd6248..8f74ef10b4f73a831d659828e5fc9aeed2188f92 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1483,9 +1483,13 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s, unsigned char *p, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST); return (NULL); } - if ((skp == NULL) || (*skp == NULL)) + if ((skp == NULL) || (*skp == NULL)) { sk = sk_SSL_CIPHER_new_null(); /* change perhaps later */ - else { + if(sk == NULL) { + SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST, ERR_R_MALLOC_FAILURE); + return NULL; + } + } else { sk = *skp; sk_SSL_CIPHER_zero(sk); }