mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Potential memory leaks in ipa-kpasswd
This patch fixes 2 situations where a pointer to allocated error string could be overwritten - which could have resulted in a memory leak. https://fedorahosted.org/freeipa/ticket/716
This commit is contained in:
parent
c69d8084c1
commit
63e70d052c
@ -925,6 +925,9 @@ kpreply:
|
||||
kdec.data[1] = result_err & 0xff;
|
||||
memcpy(&kdec.data[2], result_string, strlen(result_string));
|
||||
|
||||
free(result_string);
|
||||
result_string = NULL;
|
||||
|
||||
krberr = krb5_auth_con_setaddrs(context, auth_context, &lkaddr, NULL);
|
||||
if (krberr) {
|
||||
result_string = strdup("Failed to set local address");
|
||||
@ -938,6 +941,9 @@ kpreply:
|
||||
result_string = strdup("Failed to encrypt reply message");
|
||||
syslog(LOG_ERR, "%s: %s", result_string,
|
||||
krb5_get_error_message(context, krberr));
|
||||
|
||||
free(result_string);
|
||||
result_string = NULL;
|
||||
/* encryption was unsuccessful, let's return a krb error */
|
||||
|
||||
/* the ap data is no more useful */
|
||||
|
Loading…
Reference in New Issue
Block a user