diff options
author | Simo Sorce <idra@samba.org> | 2007-12-17 15:21:38 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2007-12-17 15:26:08 -0500 |
commit | 4869ccfed6ba8c44fb49844a5a8abbb671518954 (patch) | |
tree | 34b5ccdcbfdb4c468e7ef940e2a09d679f8e9f38 /source3 | |
parent | d20608c8f314476ca7dde8a9a61495431b4bccff (diff) | |
download | samba-4869ccfed6ba8c44fb49844a5a8abbb671518954.tar.gz samba-4869ccfed6ba8c44fb49844a5a8abbb671518954.tar.bz2 samba-4869ccfed6ba8c44fb49844a5a8abbb671518954.zip |
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)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libads/kerberos.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 227f95d15e..4fc23956bd 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -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: |