From 61dc4ff8dff2e50cd0a9f93e55125787629103a9 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 3 May 2023 17:18:01 -0400 Subject: [PATCH] krb5: fixup crypto.c avoid realloc to trim memory allocation 1b1ff8fdd571f66624cf744b2333493cc7e781d4 ("krb5: crypto.c avoid realloc to trim memory allocation") removed the realloc() but failed to assign 'p' to 'result->data'. --- lib/krb5/crypto.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/krb5/crypto.c b/lib/krb5/crypto.c index d32d7e3ca..f29a4ff43 100644 --- a/lib/krb5/crypto.c +++ b/lib/krb5/crypto.c @@ -1275,6 +1275,7 @@ decrypt_internal_derived(krb5_context context, } l = len - et->confoundersize; memmove(p, p + et->confoundersize, l); + result->data = p; result->length = l; return 0; } @@ -1355,6 +1356,7 @@ decrypt_internal_enc_then_cksum(krb5_context context, l = len - et->confoundersize; memmove(p, p + et->blocksize + et->confoundersize, l); + result->data = p; result->length = l; return 0; } @@ -1416,6 +1418,7 @@ decrypt_internal(krb5_context context, } l = len - et->confoundersize - checksum_sz; memmove(p, p + et->confoundersize + checksum_sz, l); + result->data = p; result->length = l; return 0; } @@ -1458,6 +1461,7 @@ decrypt_internal_special(krb5_context context, } memmove (p, p + cksum_sz + et->confoundersize, sz); + result->data = p; result->length = sz; return 0; }