kadm5 ad backend wrong size memset

Originally by Christos Zoulas.
This commit is contained in:
Nicolas Williams
2017-01-31 11:33:13 -06:00
committed by Viktor Dukhovni
parent 936017e4d6
commit 369945f5bc

View File

@@ -1296,11 +1296,11 @@ kadm5_ad_randkey_principal(void *server_handle,
&result_code,
&result_code_string,
&result_string);
krb5_data_free(&result_code_string);
krb5_data_free(&result_string);
if (ret == 0) {
if (ret)
goto out;
*keys = malloc(sizeof(**keys) * 1);
if (*keys == NULL) {
@@ -1314,17 +1314,16 @@ kadm5_ad_randkey_principal(void *server_handle,
password,
principal,
&(*keys)[0]);
memset(password, 0, sizeof(password));
if (ret) {
free(*keys);
*keys = NULL;
*n_keys = 0;
goto out;
}
}
out:
memset(password, 0, plen);
free(password);
out:
return ret;
#else
*keys = NULL;