Rob Shearman : rpcrt4: Reset the BufferLength to the used part of the buffer in NdrProxySendReceive .

Alexandre Julliard julliard at winehq.org
Wed Jul 2 06:03:30 CDT 2008


Module: wine
Branch: master
Commit: 182a2ae3150cdf0defd8c85c021175d1238901ca
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=182a2ae3150cdf0defd8c85c021175d1238901ca

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Tue Jul  1 23:34:12 2008 +0100

rpcrt4: Reset the BufferLength to the used part of the buffer in NdrProxySendReceive.

This avoids sending uninitialised data on the wire.

---

 dlls/rpcrt4/cproxy.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/rpcrt4/cproxy.c b/dlls/rpcrt4/cproxy.c
index 6ddaccd..8272679 100644
--- a/dlls/rpcrt4/cproxy.c
+++ b/dlls/rpcrt4/cproxy.c
@@ -385,6 +385,8 @@ void WINAPI NdrProxySendReceive(void *This,
   }
 
   pStubMsg->dwStubPhase = PROXY_SENDRECEIVE;
+  /* avoid sending uninitialised parts of the buffer on the wire */
+  pStubMsg->RpcMsg->BufferLength = pStubMsg->Buffer - (unsigned char *)pStubMsg->RpcMsg->Buffer;
   hr = IRpcChannelBuffer_SendReceive(pStubMsg->pRpcChannelBuffer,
                                     (RPCOLEMESSAGE*)pStubMsg->RpcMsg,
                                     &Status);




More information about the wine-cvs mailing list