[autobackport: sssd-2-9] ipa: check for empty trusts in ipa_get_trust_type()#8257
Conversation
Similar as ipa_get_ad_id_ctx() or ipa_get_ipa_id_ctx() ipa_get_trust_type() should be aware that the 'trusts' member of 'server_mode' might be NULL. Reviewed-by: Alexey Tikhonov <atikhono@redhat.com> (cherry picked from commit d865ac3)
There was a problem hiding this comment.
Code Review
This pull request introduces a crucial fix in ipa_get_trust_type() by adding a null check for the iter pointer. This prevents a potential null pointer dereference, enhancing the robustness and stability of the function. The change correctly handles cases where no matching trust is found, returning IPA_TRUST_UNKNOWN instead of accessing an invalid memory location.
|
|
|
The pull request was accepted by @alexey-tikhonov with the following PR CI status: 🟢 CodeQL (success) There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging. |
This is an automatic backport of PR#8254 ipa: check for empty trusts in ipa_get_trust_type() to branch sssd-2-9, created by @sumit-bose.
Please make sure this backport is correct.
Note
The commits were cherry-picked without conflicts.
You can push changes to this pull request
Original commits
d865ac3 - ipa: check for empty trusts in ipa_get_trust_type()
Backported commits
Original Pull Request Body
Similar as ipa_get_ad_id_ctx() or ipa_get_ipa_id_ctx() ipa_get_trust_type() should be aware that the 'trusts' member of 'server_mode' might be NULL.