From 4f979525e4137c536118a9c2b2b4ef798c270e27 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 18 Sep 2013 17:25:55 +0200 Subject: gensec: check for NULL gensec_security in gensec_security_by_auth_type(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have equivalent checks in other gensec_security_by_X calls already. Guenther Signed-off-by: Günther Deschner Pair-Programmed-With: Andreas Schneider Reviewed-by: Stefan Metzmacher --- auth/gensec/gensec_start.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'auth/gensec') diff --git a/auth/gensec/gensec_start.c b/auth/gensec/gensec_start.c index a5ad56e451..9487cfc3b8 100644 --- a/auth/gensec/gensec_start.c +++ b/auth/gensec/gensec_start.c @@ -230,8 +230,10 @@ _PUBLIC_ const struct gensec_security_ops *gensec_security_by_auth_type( } backends = gensec_security_mechs(gensec_security, mem_ctx); for (i=0; backends && backends[i]; i++) { - if (!gensec_security_ops_enabled(backends[i], gensec_security)) - continue; + if (gensec_security != NULL && + !gensec_security_ops_enabled(backends[i], gensec_security)) { + continue; + } if (backends[i]->auth_type == auth_type) { backend = backends[i]; talloc_free(mem_ctx); -- cgit