diff options
-rw-r--r-- | src/gnutls_hooks.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gnutls_hooks.c b/src/gnutls_hooks.c index 5ced25b..fd62164 100644 --- a/src/gnutls_hooks.c +++ b/src/gnutls_hooks.c | |||
@@ -164,6 +164,9 @@ static int cert_retrieve_fn(gnutls_session_t session, gnutls_retr_st * ret) | |||
164 | 164 | ||
165 | ctxt = gnutls_transport_get_ptr(session); | 165 | ctxt = gnutls_transport_get_ptr(session); |
166 | 166 | ||
167 | if (ctxt == NULL) | ||
168 | return GNUTLS_E_INTERNAL_ERROR; | ||
169 | |||
167 | if (gnutls_certificate_type_get( session) == GNUTLS_CRT_X509) { | 170 | if (gnutls_certificate_type_get( session) == GNUTLS_CRT_X509) { |
168 | ret->type = GNUTLS_CRT_X509; | 171 | ret->type = GNUTLS_CRT_X509; |
169 | ret->ncerts = ctxt->sc->certs_x509_num; | 172 | ret->ncerts = ctxt->sc->certs_x509_num; |