-
Notifications
You must be signed in to change notification settings - Fork 311
[6.1] Fix rare multi-packet string corruption #3513
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
* add test and simplify code to fix problems * review feedback * review feedback * review feedback
There was a problem hiding this 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 fixes a rare issue with multi-packet string corruption by correcting the logic that determines when to store and retrieve snapshot buffers during TDS protocol operations. The fix addresses cases where strings could become corrupted when they span multiple network packets.
Key changes:
- Replaces complex condition
(isStarting || isContinuing)
with simplercanContinue
check - Adds debug assertions to ensure buffer consistency when continuing operations
- Removes unnecessary nested conditional blocks for improved code clarity
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
TdsParserStateObject.cs | Updates buffer management logic in byte array and string reading methods |
netfx/TdsParser.cs | Fixes Unicode character reading logic for .NET Framework implementation |
netcore/TdsParser.cs | Fixes Unicode character reading logic for .NET Core implementation |
Any chance of a preview 3 that contains this? |
@Wraith2 Looks like 6.1.0 is planned for tomorrow. |
Oh. Well that's interesting. I thought my weekend would be free but now it'll be filled with worrying that an unknown bug might be making it out to the general public and breaking all sorts of things. |
@Wraith2 preview 2 has been out for a month, is that not sufficient? |
Not when we found two fairly important bugs in it. No. But it's not my choice. |
Due to schedule constraints another preview is not planned right now. You can build, and test the NuGet package off the main branch if needed and propose a fix for any other issue for the next Hotfix. Since this change mainly affects the large string read usecases, we've considered bringing the fix in. Do you think leaving the edge case identified in #3504 open in 6.1 is safer than fixing it with this PR? |
Absolutely not, better with the fix. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/6.1 #3513 +/- ##
===============================================
+ Coverage 66.04% 66.06% +0.02%
===============================================
Files 281 281
Lines 62416 62401 -15
===============================================
+ Hits 41221 41225 +4
+ Misses 21195 21176 -19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Ports #3505 to fix #3504 by @Wraith2