mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 06:26:00 +00:00
[AFD]: Fix read data corruption when peeking at network data (TDI_RECEIVE_PEEK is specified for a stream socket)
svn path=/trunk/; revision=48403
This commit is contained in:
parent
be40e4a043
commit
e98fc993d1
1 changed files with 3 additions and 2 deletions
|
@ -80,7 +80,7 @@ static VOID RefillSocketBuffer( PAFD_FCB FCB ) {
|
|||
static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
|
||||
PAFD_RECV_INFO RecvReq,
|
||||
PUINT TotalBytesCopied ) {
|
||||
UINT i, BytesToCopy = 0,
|
||||
UINT i, BytesToCopy = 0, FcbBytesCopied = FCB->Recv.BytesUsed;
|
||||
BytesAvailable =
|
||||
FCB->Recv.Content - FCB->Recv.BytesUsed;
|
||||
PAFD_MAPBUF Map;
|
||||
|
@ -115,12 +115,13 @@ static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
|
|||
BytesToCopy));
|
||||
|
||||
RtlCopyMemory( Map[i].BufferAddress,
|
||||
FCB->Recv.Window + FCB->Recv.BytesUsed,
|
||||
FCB->Recv.Window + FcbBytesCopied,
|
||||
BytesToCopy );
|
||||
|
||||
MmUnmapLockedPages( Map[i].BufferAddress, Map[i].Mdl );
|
||||
|
||||
*TotalBytesCopied += BytesToCopy;
|
||||
FcbBytesCopied += BytesToCopy;
|
||||
|
||||
if (!(RecvReq->TdiFlags & TDI_RECEIVE_PEEK)) {
|
||||
FCB->Recv.BytesUsed += BytesToCopy;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue