Check sk_SSL_CIPHER_new_null return value
If sk_SSL_CIPHER_new_null() returns NULL then ssl_bytes_to_cipher_list() should also return NULL. Based on an original patch by mrpre <mrpre@163.com>. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 14def5f5375594830597cc153e11c6017f6adddf)
This commit is contained in:
parent
8dfe1e4dd2
commit
edc2a76ade
@ -1510,9 +1510,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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user