Skip to content
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

Fix | Fix ArrayPool usages in TdsParser.ProcessSSPI #2449

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -25,6 +25,8 @@ internal void ProcessSSPI(int receivedLength)
throw SQL.SynchronousCallMayNotPend();
}

receivedBuff.AsSpan(receivedLength, receivedBuff.Length - receivedLength).Clear();

// allocate send buffer and initialize length
byte[] rentedSendBuff = ArrayPool<byte>.Shared.Rent((int)_authenticationProvider!.MaxSSPILength);
byte[] sendBuff = rentedSendBuff; // need to track these separately in case someone updates the ref parameter
Expand Down