summaryrefslogtreecommitdiff
path: root/source4/kdc
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2016-02-15 08:27:54 +0100
committerAlexander Bokovoy <ab@samba.org>2016-06-02 12:48:13 +0200
commit00267c9565fc82b930f6292a51234580eba4ae89 (patch)
tree417bef73ffa54a8b78c3a536e1d39ebf8e4fc355 /source4/kdc
parent3d6e18f2101f75fec2377914c71e3887049bf7e5 (diff)
downloadsamba-00267c9565fc82b930f6292a51234580eba4ae89.tar.gz
sdb: Fix NULL pointer deference if we return early
If we return because of a wrong realm in a cross forest trust case, we do not have a skdc_entry allocated. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'source4/kdc')
-rw-r--r--source4/kdc/sdb_to_kdb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source4/kdc/sdb_to_kdb.c b/source4/kdc/sdb_to_kdb.c
index ce05b626633..d842052117e 100644
--- a/source4/kdc/sdb_to_kdb.c
+++ b/source4/kdc/sdb_to_kdb.c
@@ -331,11 +331,14 @@ int sdb_entry_ex_to_kdb_entry_ex(krb5_context context,
ZERO_STRUCTP(k);
- skdc_entry = talloc_get_type(s->ctx, struct samba_kdc_entry);
+ if (s->ctx != NULL) {
+ skdc_entry = talloc_get_type(s->ctx, struct samba_kdc_entry);
- k->e_data = (void *)skdc_entry;
+ k->e_data = (void *)skdc_entry;
- talloc_set_destructor(skdc_entry, samba_kdc_kdb_entry_destructor);
+ talloc_set_destructor(skdc_entry,
+ samba_kdc_kdb_entry_destructor);
+ }
return sdb_entry_ex_to_krb5_db_entry(context, &s->entry, k);
}