diff options
author | corvid <devnull@localhost> | 2015-05-30 22:37:38 +0000 |
---|---|---|
committer | corvid <devnull@localhost> | 2015-05-30 22:37:38 +0000 |
commit | 7bc101f0e1c65b688715bec4d1917a358ebd0d75 (patch) | |
tree | 7a976d8070618657014156209f7cb0622665b2eb /src/IO | |
parent | 608d1a61b202814080d680f9a1c33e72a926ae8c (diff) |
fix warning
Diffstat (limited to 'src/IO')
-rw-r--r-- | src/IO/tls.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/IO/tls.c b/src/IO/tls.c index 9368d563..6355f4f5 100644 --- a/src/IO/tls.c +++ b/src/IO/tls.c @@ -940,7 +940,7 @@ static void Tls_print_cert_chain(SSL *ssl) const uint_t buflen = 4096; char buf[buflen]; int i, n = sk_X509_num(sk); - X509 *cert; + X509 *cert = NULL; EVP_PKEY *public_key; int key_type, key_bits; const char *type_str; @@ -966,9 +966,11 @@ static void Tls_print_cert_chain(SSL *ssl) } } - X509_NAME_oneline(X509_get_issuer_name(cert), buf, buflen); - buf[buflen-1] = '\0'; - MSG("root: %s\n", buf); + if (cert) { + X509_NAME_oneline(X509_get_issuer_name(cert), buf, buflen); + buf[buflen-1] = '\0'; + MSG("root: %s\n", buf); + } } } |