From 03c2f9b48cef58567b6298fbaa3e9c4519976b7a Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 6 Mar 2003 22:30:36 +0000 Subject: [PATCH] * preauth2.c (pa_sam_2): Add intermediate size_t variable to hold output of krb5_c_encrypt_length(). ticket: 1373 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15264 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 5 +++++ src/lib/krb5/krb/preauth2.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index c83f241df..852969dad 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +2003-03-06 Tom Yu + + * preauth2.c (pa_sam_2): Add intermediate size_t variable to hold + output of krb5_c_encrypt_length(). + 2003-03-06 Alexandra Ellwood * appdefault.c: Fix constness to avoid warning. diff --git a/src/lib/krb5/krb/preauth2.c b/src/lib/krb5/krb/preauth2.c index 27eb00f62..e50440e2b 100644 --- a/src/lib/krb5/krb/preauth2.c +++ b/src/lib/krb5/krb/preauth2.c @@ -493,6 +493,7 @@ krb5_error_code pa_sam_2(krb5_context context, krb5_boolean valid_cksum = 0; krb5_enc_sam_response_enc_2 enc_sam_response_enc_2; krb5_sam_response_2 sr2; + size_t ciph_len; krb5_pa_data *sam_padata; if (prompter == NULL) @@ -737,12 +738,13 @@ krb5_error_code pa_sam_2(krb5_context context, /* enc_sam_response_enc_2 from above */ retval = krb5_c_encrypt_length(context, as_key->enctype, scratch->length, - (size_t *) &sr2.sam_enc_nonce_or_sad.ciphertext.length); + &ciph_len); if (retval) { krb5_free_sam_challenge_2(context, sc2); krb5_free_sam_challenge_2_body(context, sc2b); return(retval); } + sr2.sam_enc_nonce_or_sad.ciphertext.length = ciph_len; sr2.sam_enc_nonce_or_sad.ciphertext.data = (char *)malloc(sr2.sam_enc_nonce_or_sad.ciphertext.length); -- 2.26.2