aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nokis Mavrogiannopoulos 2008-09-14 14:08:52 +0000
committerGravatar Nokis Mavrogiannopoulos 2008-09-14 14:08:52 +0000
commit27b989ea5438d0cf3fb87dabef6026c535c92a99 (patch)
treebedfe0a40d0033f9d9dc5260c15b323687e02ef9 /src
parent7729b49ab60c5acbc19851705a7f453afaed78fa (diff)
added check for invalid context
Diffstat (limited to 'src')
-rw-r--r--src/gnutls_hooks.c3
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;