提交 28b958f7 编写于 作者: R Richard Levitte

Fix possible NULL dereferencial.

Notified by Verdon Walker <VWalker@novell.com>
上级 4e59cd3b
...@@ -1073,14 +1073,17 @@ int ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap, ...@@ -1073,14 +1073,17 @@ int ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap,
* preference */ * preference */
STACK_OF(SSL_CIPHER) *SSL_get_ciphers(SSL *s) STACK_OF(SSL_CIPHER) *SSL_get_ciphers(SSL *s)
{ {
if ((s != NULL) && (s->cipher_list != NULL)) if (s != NULL)
{
return(s->cipher_list);
}
else if ((s->ctx != NULL) &&
(s->ctx->cipher_list != NULL))
{ {
return(s->ctx->cipher_list); if (s->cipher_list != NULL)
{
return(s->cipher_list);
}
else if ((s->ctx != NULL) &&
(s->ctx->cipher_list != NULL))
{
return(s->ctx->cipher_list);
}
} }
return(NULL); return(NULL);
} }
...@@ -1089,14 +1092,17 @@ STACK_OF(SSL_CIPHER) *SSL_get_ciphers(SSL *s) ...@@ -1089,14 +1092,17 @@ STACK_OF(SSL_CIPHER) *SSL_get_ciphers(SSL *s)
* algorithm id */ * algorithm id */
STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s) STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s)
{ {
if ((s != NULL) && (s->cipher_list_by_id != NULL)) if (s != NULL)
{
return(s->cipher_list_by_id);
}
else if ((s != NULL) && (s->ctx != NULL) &&
(s->ctx->cipher_list_by_id != NULL))
{ {
return(s->ctx->cipher_list_by_id); if (s->cipher_list_by_id != NULL)
{
return(s->cipher_list_by_id);
}
else if ((s->ctx != NULL) &&
(s->ctx->cipher_list_by_id != NULL))
{
return(s->ctx->cipher_list_by_id);
}
} }
return(NULL); return(NULL);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册