diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-07-09 12:12:50 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-07-09 13:49:21 -0400 |
commit | 84a4e4533b3af5b170e19827f428b7df76b69d71 (patch) | |
tree | 2f2351b4b681fd917509b0a55f4aed86b6c80275 /src/util | |
parent | 6fcbc4eaf94b9772dd7c6a6c40763387365ee4f6 (diff) | |
download | sssd-84a4e4533b3af5b170e19827f428b7df76b69d71.tar.gz sssd-84a4e4533b3af5b170e19827f428b7df76b69d71.tar.xz sssd-84a4e4533b3af5b170e19827f428b7df76b69d71.zip |
Check for errors from krb5_unparse_name
Coverity #12781
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/sss_krb5.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c index 8180d73d5..24229f8b3 100644 --- a/src/util/sss_krb5.c +++ b/src/util/sss_krb5.c @@ -327,7 +327,14 @@ int sss_krb5_verify_keytab_ex(const char *principal, const char *keytab_name, found = false; while((krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0){ - krb5_unparse_name(context, entry.principal, &kt_principal); + krberr = krb5_unparse_name(context, entry.principal, &kt_principal); + if (krberr) { + DEBUG(SSSDBG_FATAL_FAILURE, + ("Could not parse keytab entry\n")); + sss_log(SSS_LOG_ERR, "Could not parse keytab entry\n"); + return EIO; + } + if (strcmp(principal, kt_principal) == 0) { found = true; } |