If krb5_encrypt_keyhelper() returns an error, the ciphertext structure
may contain a non-zero length, but it will already have freed the
pointer to its data, making encrypt_credencpart()'s subsequent attempt
to clear and free the memory fail. Remove that logic.
Based on a patch from Jatin Nansi.
ticket: 7948 (new)
target_version: 1.12.2
tags: pullup
KRB5_KEYUSAGE_KRB_CRED_ENCPART, scratch,
pencdata);
- if (retval) {
- memset(pencdata->ciphertext.data, 0, pencdata->ciphertext.length);
- free(pencdata->ciphertext.data);
- pencdata->ciphertext.length = 0;
- pencdata->ciphertext.data = 0;
- }
-
memset(scratch->data, 0, scratch->length);
krb5_free_data(context, scratch);