Rob Shearman : rpcrt4: Memory should only be cleared in ComplexUnmarshall, not in ComplexMarshall.
Alexandre Julliard
julliard at winehq.org
Thu Dec 20 06:21:39 CST 2007
Module: wine
Branch: master
Commit: 22b20879f7b7779644b0be21729ec23f9c783536
URL: http://source.winehq.org/git/wine.git/?a=commit;h=22b20879f7b7779644b0be21729ec23f9c783536
Author: Rob Shearman <rob at codeweavers.com>
Date: Wed Dec 19 14:53:12 2007 +0000
rpcrt4: Memory should only be cleared in ComplexUnmarshall, not in ComplexMarshall.
Also clear memory when FC_STRUCTPAD* is encountered.
---
dlls/rpcrt4/ndr_marshall.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index 6aabb23..0167bcf 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -2008,10 +2008,10 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg,
break;
}
case RPC_FC_ALIGNM4:
- ALIGN_POINTER_CLEAR(pMemory, 4);
+ ALIGN_POINTER(pMemory, 4);
break;
case RPC_FC_ALIGNM8:
- ALIGN_POINTER_CLEAR(pMemory, 8);
+ ALIGN_POINTER(pMemory, 8);
break;
case RPC_FC_STRUCTPAD1:
case RPC_FC_STRUCTPAD2:
@@ -2127,10 +2127,10 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
break;
}
case RPC_FC_ALIGNM4:
- ALIGN_POINTER(pMemory, 4);
+ ALIGN_POINTER_CLEAR(pMemory, 4);
break;
case RPC_FC_ALIGNM8:
- ALIGN_POINTER(pMemory, 8);
+ ALIGN_POINTER_CLEAR(pMemory, 8);
break;
case RPC_FC_STRUCTPAD1:
case RPC_FC_STRUCTPAD2:
@@ -2139,6 +2139,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
case RPC_FC_STRUCTPAD5:
case RPC_FC_STRUCTPAD6:
case RPC_FC_STRUCTPAD7:
+ memset(pMemory, 0, *pFormat - RPC_FC_STRUCTPAD1 + 1);
pMemory += *pFormat - RPC_FC_STRUCTPAD1 + 1;
break;
case RPC_FC_EMBEDDED_COMPLEX:
More information about the wine-cvs
mailing list