summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2013-09-18 17:25:55 +0200
committerGünther Deschner <gd@samba.org>2013-09-19 11:09:06 +0200
commit4f979525e4137c536118a9c2b2b4ef798c270e27 (patch)
tree16399e03ce642bfdfac23aa754a7340b0bf1782a
parentd433ad077f354de4fc1d5a155d991f417ae9967c (diff)
downloadsamba-4f979525e4137c536118a9c2b2b4ef798c270e27.tar.gz
samba-4f979525e4137c536118a9c2b2b4ef798c270e27.tar.bz2
samba-4f979525e4137c536118a9c2b2b4ef798c270e27.zip
gensec: check for NULL gensec_security in gensec_security_by_auth_type().
We have equivalent checks in other gensec_security_by_X calls already. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Pair-Programmed-With: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--auth/gensec/gensec_start.c6
1 files changed, 4 insertions, 2 deletions
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);