summaryrefslogtreecommitdiff
path: root/auth/gensec/gensec_start.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-03-01 19:29:40 +0100
committerStefan Metzmacher <metze@samba.org>2016-03-10 06:52:27 +0100
commit64364e365c56c93e86305a536c5c68450d154d2a (patch)
tree67389629e1916b3235e44d80bdb1aa27df8c51d4 /auth/gensec/gensec_start.c
parent5e913af833721733c4f79f2636fc3ae19d5f42f0 (diff)
downloadsamba-64364e365c56c93e86305a536c5c68450d154d2a.tar.gz
auth/gensec: handle gensec_security_by_sasl_name(NULL, ...)
We do that for all other gensec_security_by_*() functions already. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth/gensec/gensec_start.c')
-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 be316978a0b..8d4bfa76a9e 100644
--- a/auth/gensec/gensec_start.c
+++ b/auth/gensec/gensec_start.c
@@ -211,8 +211,10 @@ _PUBLIC_ const struct gensec_security_ops *gensec_security_by_sasl_name(
}
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]->sasl_name
&& (strcmp(backends[i]->sasl_name, sasl_name) == 0)) {
backend = backends[i];