Skip to content

ipa: check for empty trusts in ipa_get_trust_type()#8254

Merged
alexey-tikhonov merged 1 commit intoSSSD:masterfrom
sumit-bose:empty_trusts
Dec 2, 2025
Merged

ipa: check for empty trusts in ipa_get_trust_type()#8254
alexey-tikhonov merged 1 commit intoSSSD:masterfrom
sumit-bose:empty_trusts

Conversation

@sumit-bose
Copy link
Contributor

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.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a potential NULL pointer dereference in ipa_get_trust_type. When the trust list is empty or no matching trust is found, the original code would attempt to dereference a NULL or uninitialized pointer, leading to a crash. The added check ensures the function safely returns IPA_TRUST_UNKNOWN in such cases, which is the correct behavior and consistent with similar functions in the codebase. This is an important fix for stability.

@alexey-tikhonov alexey-tikhonov added the Trivial A single reviewer is sufficient to review the Pull Request label Dec 2, 2025
@alexey-tikhonov alexey-tikhonov self-assigned this Dec 2, 2025
@alexey-tikhonov alexey-tikhonov added the coverity Trigger a coverity scan label Dec 2, 2025
@alexey-tikhonov
Copy link
Member

Note: no new issues reported by Covcan.

@alexey-tikhonov alexey-tikhonov added Accepted and removed coverity Trigger a coverity scan labels Dec 2, 2025
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>
@sssd-bot
Copy link
Contributor

sssd-bot commented Dec 2, 2025

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 CodeFactor (success)
🟢 CodeQL (success)
🟢 osh-diff-scan:fedora-rawhide-x86_64:upstream (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-41-x86_64:upstream (success)
🟢 rpm-build:fedora-42-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 Analyze (target) / cppcheck (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🔴 ci / intgcheck (centos-10) (failure)
🟢 ci / intgcheck (fedora-41) (success)
🟢 ci / intgcheck (fedora-42) (success)
🟢 ci / intgcheck (fedora-43) (success)
🟢 ci / intgcheck (fedora-44) (success)
🟢 ci / prepare (success)
🟢 ci / system (centos-10) (success)
🟢 ci / system (fedora-41) (success)
🟢 ci / system (fedora-42) (success)
🟢 ci / system (fedora-43) (success)
🟢 ci / system (fedora-44) (success)
➖ Coverity scan / coverity (skipped)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@alexey-tikhonov alexey-tikhonov merged commit d865ac3 into SSSD:master Dec 2, 2025
11 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accepted backport-to-sssd-2-9 Trivial A single reviewer is sufficient to review the Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants