Skip to content

Commit

Permalink
Covscan issues: deadcode and Use after free
Browse files Browse the repository at this point in the history
Covscan detected an unused value in ipa_kdb_principals.c
and a use-after-free in ipa-print-pac.c.

Fixes: https://pagure.io/freeipa/issue/9431

Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
  • Loading branch information
flo-renaud committed Sep 29, 2023
1 parent 4af05dd commit 8b70ee1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion daemons/ipa-kdb/ipa-print-pac.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ init_with_password(const char *name, const char *password)

done:
if (service_creds != GSS_C_NO_CREDENTIAL)
gss_release_cred(&min, &client_creds);
gss_release_cred(&min, &service_creds);

if (client_creds != GSS_C_NO_CREDENTIAL)
gss_release_cred(&min, &client_creds);
Expand Down
3 changes: 3 additions & 0 deletions daemons/ipa-kdb/ipa_kdb_principals.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,9 @@ krb5_error_code ipadb_get_principal(krb5_context kcontext,
kerr = krb5_dbe_set_string(kcontext, *entry,
KRB5_KDB_SK_PAC_PRIVSVR_ENCTYPE,
"aes256-sha1");
if (kerr)
return kerr;

}

/* We should have been initialized at this point already */
Expand Down

0 comments on commit 8b70ee1

Please sign in to comment.