summaryrefslogtreecommitdiffstats
path: root/proxy/src/gp_export.c
diff options
context:
space:
mode:
Diffstat (limited to 'proxy/src/gp_export.c')
-rw-r--r--proxy/src/gp_export.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/proxy/src/gp_export.c b/proxy/src/gp_export.c
index b855c74..341ef0a 100644
--- a/proxy/src/gp_export.c
+++ b/proxy/src/gp_export.c
@@ -113,6 +113,7 @@ static int gp_encrypt_buffer(krb5_context context, krb5_keyblock *key,
int ret;
krb5_data data_in;
krb5_enc_data enc_handle;
+ size_t cipherlen;
data_in.length = len;
data_in.data = buf;
@@ -122,11 +123,12 @@ static int gp_encrypt_buffer(krb5_context context, krb5_keyblock *key,
ret = krb5_c_encrypt_length(context,
GP_CREDS_HANDLE_KEY_ENCTYPE,
data_in.length,
- (size_t *)&enc_handle.ciphertext.length);
+ &cipherlen);
if (ret) {
goto done;
}
+ enc_handle.ciphertext.length = cipherlen;
enc_handle.ciphertext.data = malloc(enc_handle.ciphertext.length);
if (!enc_handle.ciphertext.data) {
ret = ENOMEM;