Skip to content

fix(github): guard checkWebhookSecretValidity against nil response #2162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

zakisk
Copy link
Contributor

@zakisk zakisk commented Jul 4, 2025

Fix nil-pointer panic when /rate_limit returns success without SCIM data or when the HTTP response itself is nil.
Add early err/resp checks and ensure rl and rl.SCIM are non-nil before accessing them.

Jira: https://issues.redhat.com/browse/SRVKP-8075

Changes

Submitter Checklist

  • 📝 Ensure your commit message is clear and informative. Refer to the How to write a git commit message guide. Include the commit message in the PR body rather than linking to an external site (e.g., Jira ticket).

  • ♽ Run make test lint before submitting a PR to avoid unnecessary CI processing. Consider installing pre-commit and running pre-commit install in the repository root for an efficient workflow.

  • ✨ We use linters to maintain clean and consistent code. Run make lint before submitting a PR. Some linters offer a --fix mode, executable with make fix-linters (ensure markdownlint and golangci-lint are installed).

  • 🧪 While 100% coverage isn't required, we encourage unit tests for code changes where possible.

  • If adding a provider feature, fill in the following details:

    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

    (update the provider documentation accordingly)

Fix nil-pointer panic when /rate_limit returns success without SCIM data
or when the HTTP response itself is nil.
Add early err/resp checks and ensure rl and rl.SCIM are non-nil
before accessing them.

Jira: https://issues.redhat.com/browse/SRVKP-8075

Signed-off-by: Zaki Shaikh <zashaikh@redhat.com>
@zakisk zakisk force-pushed the SRVKP-8075-fix-panic-in-pac-controller-for-token branch from deb3981 to d39cda9 Compare July 4, 2025 07:11
@zakisk zakisk requested a review from chmouel July 4, 2025 07:12
@chmouel chmouel merged commit e18edee into openshift-pipelines:main Jul 4, 2025
4 checks passed
@zakisk zakisk deleted the SRVKP-8075-fix-panic-in-pac-controller-for-token branch July 5, 2025 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants