diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-01-31 01:48:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:51:37 -0500 |
commit | a0060cb3435d727340c74f1a8b123ce7ce1d93d2 (patch) | |
tree | 303c685f9227ba1b9d7562e6fa93b3d119a2ecf2 | |
parent | b70009649a23ee8f0e88c1b9935e739537f4a960 (diff) | |
download | samba-a0060cb3435d727340c74f1a8b123ce7ce1d93d2.tar.gz samba-a0060cb3435d727340c74f1a8b123ce7ce1d93d2.tar.bz2 samba-a0060cb3435d727340c74f1a8b123ce7ce1d93d2.zip |
r13245: Don't segfault if we don't have a credentials structure on this gensec
context.
Andrew Bartlett
(This used to be commit 1e840aa43679ceccb2a3afc694a5de0828147e8c)
-rw-r--r-- | source4/auth/gensec/gensec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c index 4853b53e40..0832f2b07a 100644 --- a/source4/auth/gensec/gensec.c +++ b/source4/auth/gensec/gensec.c @@ -104,12 +104,15 @@ struct gensec_security_ops **gensec_security_mechs(struct gensec_security *gense talloc_reference(mem_ctx, backends); return backends; } else { + enum credentials_use_kerberos use_kerberos; struct cli_credentials *creds = gensec_get_credentials(gensec_security); - enum credentials_use_kerberos use_kerberos - = cli_credentials_get_kerberos_state(creds); + if (!creds) { + talloc_reference(mem_ctx, backends); + return backends; + } + use_kerberos = cli_credentials_get_kerberos_state(creds); return gensec_use_kerberos_mechs(mem_ctx, backends, use_kerberos); } - } static const struct gensec_security_ops *gensec_security_by_authtype(struct gensec_security *gensec_security, |