auth/gensec: make sure gensec_security_by_auth_type() returns NULL for AUTH_TYPE_NONE
authorStefan Metzmacher <metze@samba.org>
Fri, 10 Jul 2015 11:01:47 +0000 (13:01 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 Mar 2016 16:17:16 +0000 (17:17 +0100)
ops->auth_type == 0, means the backend doesn't support DCERPC.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
auth/gensec/gensec_start.c

index bb9cd18175283712f6f5d7d623fd737233dcdae7..4c43519f26d415e2dfd0f895eb62ea89e3ac0cd0 100644 (file)
@@ -234,7 +234,13 @@ _PUBLIC_ const struct gensec_security_ops *gensec_security_by_auth_type(
        int i;
        const struct gensec_security_ops **backends;
        const struct gensec_security_ops *backend;
-       TALLOC_CTX *mem_ctx = talloc_new(gensec_security);
+       TALLOC_CTX *mem_ctx;
+
+       if (auth_type == DCERPC_AUTH_TYPE_NONE) {
+               return NULL;
+       }
+
+       mem_ctx = talloc_new(gensec_security);
        if (!mem_ctx) {
                return NULL;
        }