Skip to content

Conversation

@apoorvdeshmukh
Copy link
Contributor

Description

Port #3857 to release/6.1
Closes #3845

Issues

#3845

Testing

To be introduced when addressing #3876

Guidelines

Please review the contribution guidelines before submitting a pull request:

@apoorvdeshmukh apoorvdeshmukh added this to the 6.1.4 milestone Jan 12, 2026
Copilot AI review requested due to automatic review settings January 12, 2026 05:00
@apoorvdeshmukh apoorvdeshmukh requested a review from a team as a code owner January 12, 2026 05:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR ports a bug fix from PR #3857 to the release/6.1 branch, addressing issue #3845. The fix prevents a potential NullReferenceException when processing batch RPC commands with Always Encrypted enabled.

Changes:

  • Added a null check for systemParams before accessing its Length property in the TryFetchInputParameterEncryptionInfo method
  • Applied the fix consistently to both .NET Framework and .NET Core implementations

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs Added null check before accessing systemParams.Length in batch RPC mode parameter encryption logic
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs Added null check before accessing systemParams.Length in batch RPC mode parameter encryption logic

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.64%. Comparing base (a20f10a) to head (cb45256).
⚠️ Report is 1 commits behind head on release/6.1.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/6.1    #3877      +/-   ##
===============================================
- Coverage        65.42%   63.64%   -1.79%     
===============================================
  Files              279      279              
  Lines            53302    53302              
===============================================
- Hits             34875    33924     -951     
- Misses           18427    19378     +951     
Flag Coverage Δ
addons 90.82% <ø> (ø)
netcore 67.62% <100.00%> (-0.76%) ⬇️
netfx 67.78% <100.00%> (-1.70%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@apoorvdeshmukh apoorvdeshmukh merged commit 6daa25b into release/6.1 Jan 12, 2026
258 checks passed
@apoorvdeshmukh apoorvdeshmukh deleted the dev/ad/port3857to61 branch January 12, 2026 13:02
This was referenced Jan 16, 2026
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.

4 participants