From 27b989ea5438d0cf3fb87dabef6026c535c92a99 Mon Sep 17 00:00:00 2001 From: Nokis Mavrogiannopoulos Date: Sun, 14 Sep 2008 14:08:52 +0000 Subject: added check for invalid context --- src/gnutls_hooks.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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) ctxt = gnutls_transport_get_ptr(session); + if (ctxt == NULL) + return GNUTLS_E_INTERNAL_ERROR; + if (gnutls_certificate_type_get( session) == GNUTLS_CRT_X509) { ret->type = GNUTLS_CRT_X509; ret->ncerts = ctxt->sc->certs_x509_num; -- cgit