gensec: Fix a memory corruption in gensec_use_kerberos_mechs
[nivanova/samba-autobuild/.git] / auth / gensec / gensec_start.c
index 08b2fb68cb14b01e64e6a81c5480a3ea8acdba05..ab092a7bb17b5355fbf34b90a175bb6aa6071f54 100644 (file)
@@ -75,7 +75,8 @@ _PUBLIC_ struct gensec_security_ops **gensec_use_kerberos_mechs(TALLOC_CTX *mem_
                /* noop */
        }
 
-       new_gensec_list = talloc_array(mem_ctx, struct gensec_security_ops *, num_mechs_in + 1);
+       new_gensec_list = talloc_array(mem_ctx, struct gensec_security_ops *,
+                                      num_mechs_in*2 + 1);
        if (!new_gensec_list) {
                return NULL;
        }