lib/krb5: krb5_init_creds_set_service fail if set_realm fails
commit29940dd22c97a5b32007cf943a26d6a48d666c62
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 20 Jan 2022 14:44:43 +0000 (20 09:44 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 20 Jan 2022 14:44:43 +0000 (20 09:44 -0500)
tree2694aa0e7ee643ad75bb3eb63d23368ba262b794
parent8324a2af1dcd09dd574a2e155bd10458fcbdf8e2
lib/krb5: krb5_init_creds_set_service fail if set_realm fails

Calls to krb5_principal_set_realm() can fail due to memory
allocation failures.  If the client realm cannot be set in
the generated principal the wrong realm will be used.
Check for the result of krb5_principal_set_realm() and if
there is a failure, clean up and return the error code to
the caller.

Change-Id: Icadd04c858e88c1ba1d4344c60a784885a6a1344
lib/krb5/init_creds_pw.c