aboutsummaryrefslogtreecommitdiff
path: root/lib/vtls
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-05-17 09:14:06 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-05-17 09:14:06 +0200
commit8132fe11b320b6c73bd5fc8de37dd1d6a8f9a8da (patch)
tree5d20d1cfebb93b121089f87282a75e8d92647976 /lib/vtls
parentb4990734066b6333f4a6b68718afafa1ecaa928d (diff)
openssl: get_cert_chain: avoid NULL dereference
CID 1361811: Explicit null dereferenced (FORWARD_NULL)
Diffstat (limited to 'lib/vtls')
-rw-r--r--lib/vtls/openssl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 6b70c0ccc..93373e03d 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -2385,10 +2385,12 @@ static CURLcode get_cert_chain(struct connectdata *conn,
X509_get0_signature(&psig, &palg, x);
X509_signature_print(mem, palg, a);
ASN1_STRING_free(a);
- }
- i2a_ASN1_OBJECT(mem, palg->algorithm);
- push_certinfo("Public Key Algorithm", i);
+ if(palg) {
+ i2a_ASN1_OBJECT(mem, palg->algorithm);
+ push_certinfo("Public Key Algorithm", i);
+ }
+ }
X509V3_ext(data, i, X509_get0_extensions(x));
}
#else