From 4f5677cda9b3cfb593ff28739714829b5888bd51 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Fri, 3 Jul 2020 19:15:45 +0200 Subject: [PATCH] Offset edge case bug fix --- .../src/System/Net/Sockets/SocketAsyncContext.Unix.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs index 2a5c3c3587d8d1..c145c7471dce0e 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs @@ -430,7 +430,7 @@ public BufferPtrSendOperation(SocketAsyncContext context) : base(context) { } protected override bool DoTryComplete(SocketAsyncContext context) { int bufferIndex = 0; - return SocketPal.TryCompleteSendTo(context._socket, new ReadOnlySpan(BufferPtr, Offset + Count), null, ref bufferIndex, ref Offset, ref Count, Flags, SocketAddress, SocketAddressLen, ref BytesTransferred, out ErrorCode); + return SocketPal.TryCompleteSendTo(context._socket, new ReadOnlySpan(BufferPtr + Offset, Count), null, ref bufferIndex, ref Offset, ref Count, Flags, SocketAddress, SocketAddressLen, ref BytesTransferred, out ErrorCode); } }