Skip to content

fix: CA cert pool should be cloned not returned as pointer#455

Merged
fredbi merged 1 commit into
masterfrom
ai-findings-autofix/client-tls.go
May 14, 2026
Merged

fix: CA cert pool should be cloned not returned as pointer#455
fredbi merged 1 commit into
masterfrom
ai-findings-autofix/client-tls.go

Conversation

@fredbi
Copy link
Copy Markdown
Member

@fredbi fredbi commented May 14, 2026

This PR applies 2/2 suggestions from code quality AI findings.

Signed-off-by: Frederic BIDON fredbi@yahoo.com

@fredbi fredbi marked this pull request as ready for review May 14, 2026 22:17
@fredbi fredbi changed the title Potential fixes for 2 code quality findings fix: CA cert pool should be cloned not returned as pointer May 14, 2026
The basePool function returns the input pool directly without cloning it.
According to the documentation in TLSClientOptions, callers must not use the supplied pool after calling TLSClientAuth.
However, when the pool is non-nil, this function returns it as-is,
which could lead to unintended mutations if the caller continues using it.
Consider cloning the pool or updating the implementation to match the documented contract.

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@9d29f68). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #455   +/-   ##
=========================================
  Coverage          ?   83.45%           
=========================================
  Files             ?       62           
  Lines             ?     4387           
  Branches          ?        0           
=========================================
  Hits              ?     3661           
  Misses            ?      567           
  Partials          ?      159           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fredbi fredbi force-pushed the ai-findings-autofix/client-tls.go branch from 00b5953 to d1b1ffc Compare May 14, 2026 22:23
@fredbi fredbi merged commit c925891 into master May 14, 2026
22 checks passed
@fredbi fredbi deleted the ai-findings-autofix/client-tls.go branch May 14, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant