mirror of
https://github.com/samba-team/samba.git
synced 2025-03-08 04:58:40 +03:00
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>
This commit is contained in:
parent
3d6e18f210
commit
00267c9565
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user