aboutsummaryrefslogtreecommitdiff
path: root/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2003-01-16 06:00:55 +0000
committerRichard Levitte <levitte@openssl.org>2003-01-16 06:00:55 +0000
commit28b958f732a7a09bb67ba142cb96573731a79392 (patch)
tree0acb297e5f29fce6288bbbc093413a455fc68b46 /ssl/ssl_lib.c
parent4e59cd3bb6d31bbe31575a3dad2cbd4a1b2865dd (diff)
downloadopenssl-28b958f732a7a09bb67ba142cb96573731a79392.zip
openssl-28b958f732a7a09bb67ba142cb96573731a79392.tar.gz
openssl-28b958f732a7a09bb67ba142cb96573731a79392.tar.bz2
Fix possible NULL dereferencial.
Notified by Verdon Walker <VWalker@novell.com>
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r--ssl/ssl_lib.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index f411267..68c7ae7 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1073,14 +1073,17 @@ int ssl_cipher_ptr_id_cmp(const SSL_CIPHER * const *ap,
* preference */
STACK_OF(SSL_CIPHER) *SSL_get_ciphers(SSL *s)
{
- if ((s != NULL) && (s->cipher_list != NULL))
- {
- return(s->cipher_list);
- }
- else if ((s->ctx != NULL) &&
- (s->ctx->cipher_list != NULL))
+ if (s != 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);
}
@@ -1089,14 +1092,17 @@ STACK_OF(SSL_CIPHER) *SSL_get_ciphers(SSL *s)
* algorithm id */
STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s)
{
- if ((s != NULL) && (s->cipher_list_by_id != NULL))
- {
- return(s->cipher_list_by_id);
- }
- else if ((s != NULL) && (s->ctx != NULL) &&
- (s->ctx->cipher_list_by_id != NULL))
+ if (s != 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);
}