heimdal: kadm5_c_get_principal() should check return code

kadm5_c_get_principal() should check the return code from
kadm5_ret_principal_ent(). As it doesn't it assumes success when
there is none and can lead to potential vulnerability. Fix this.

Reported by:	rtm@csail.mit.edu
MFC after:	3 days
This commit is contained in:
Cy Schubert 2022-12-09 06:06:04 -08:00
parent 3deefb0d14
commit f6d5d31cd5

View file

@ -77,7 +77,7 @@ kadm5_c_get_principal(void *server_handle,
ret = tmp;
krb5_clear_error_message(context->context);
if(ret == 0)
kadm5_ret_principal_ent(sp, out);
ret = kadm5_ret_principal_ent(sp, out);
krb5_storage_free(sp);
krb5_data_free (&reply);
return ret;