Skip to content

Commit c43f86f

Browse files
committed
fix sendLength issue
1 parent 43ec92d commit c43f86f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SSPI/NativeSSPIContextProvider.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ protected override void GenerateSspiClientContext(ReadOnlySpan<byte> incomingBlo
5858
SNIHandle handle = _physicalStateObj.SessionHandle.NativeHandle;
5959
#endif
6060

61-
var outBuff = outgoingBlobWriter.GetSpan((int)s_maxSSPILength);
62-
uint sendLength = 0;
61+
// this must start as the length of the input, but will be updated by the call to SNISecGenClientContext to the written length
62+
var sendLength = s_maxSSPILength;
63+
var outBuff = outgoingBlobWriter.GetSpan((int)sendLength);
6364

6465
if (0 != SniNativeWrapper.SNISecGenClientContext(handle, incomingBlob, outBuff, ref sendLength, _sniSpnBuffer[0]))
6566
{

0 commit comments

Comments
 (0)