diff options
author | Richard Levitte <levitte@openssl.org> | 2003-01-16 09:00:59 +0300 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2003-01-16 09:00:59 +0300 |
commit | bc35d57932c3441d91ee94d2e25b4fdad306d807 (patch) | |
tree | 137597a4d9b2fa2dea3d8527392029661a3c484d /ssl | |
parent | dd1a3c26bad47acc9d9b87ef08d0e39d1cafb031 (diff) |
Fix possible NULL dereferencial.
Notified by Verdon Walker <VWalker@novell.com>
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_lib.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 091326f5d6..12c4488c3c 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1069,14 +1069,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); } @@ -1085,14 +1088,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); } |