summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2014-05-12 18:19:14 +0200
committerMatt Caswell <matt@openssl.org>2014-05-12 22:59:11 +0100
commit1f5bce2dcebbb5059c2a5ecf4037432e8041cc07 (patch)
treee17fae4cc1ca9fcb830995dcaa85cd126ae1b592 /ssl
parentb953b02849cfc3ad0757b92198780d023a57b3ec (diff)
Check sk_SSL_CIPHER_num() after assigning sk.
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 0a7e2aad2d..00b26ba429 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1467,11 +1467,12 @@ char *SSL_get_shared_ciphers(const SSL *s,char *buf,int len)
(len < 2))
return(NULL);
+ p=buf;
+ sk=s->session->ciphers;
+
if (sk_SSL_CIPHER_num(sk) == 0)
return NULL;
- p=buf;
- sk=s->session->ciphers;
for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
{
int n;