mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
While 'data' is usually 0 terminated, nothing in the spec requires that. The correct way is to copy only 'length' bytes.
Simo. (This used to be commit 814c1b0e0034fb67c7718760dfcf913904f3e7fa)
This commit is contained in:
parent
d20608c8f3
commit
4869ccfed6
@ -521,7 +521,10 @@ char *kerberos_get_default_realm_from_ccache( void )
|
||||
#if defined(HAVE_KRB5_PRINCIPAL_GET_REALM)
|
||||
realm = SMB_STRDUP(krb5_principal_get_realm(ctx, princ));
|
||||
#elif defined(HAVE_KRB5_PRINC_REALM)
|
||||
realm = SMB_STRDUP(krb5_princ_realm(ctx, princ)->data);
|
||||
{
|
||||
krb5_data *realm_data = krb5_princ_realm(ctx, princ);
|
||||
realm = SMB_STRNDUP(realm_data->data, realm_data->length);
|
||||
}
|
||||
#endif
|
||||
|
||||
out:
|
||||
|
Loading…
x
Reference in New Issue
Block a user