Module: wine Branch: refs/heads/master Commit: d98b73a17ac2903001854b2fc80aad0550995cb2 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=d98b73a17ac2903001854b2f...
Author: Robert Shearman rob@codeweavers.com Date: Fri Jun 9 17:29:28 2006 +0100
rpcrt4: Clear an object pointer during unmarshaling, otherwise we could end up using the previously allocated memory even if it isn't the right size, causing heap corruption.
---
dlls/rpcrt4/ndr_marshall.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c index 7bddb4f..6143c0c 100644 --- a/dlls/rpcrt4/ndr_marshall.c +++ b/dlls/rpcrt4/ndr_marshall.c @@ -842,7 +842,10 @@ static void PointerUnmarshall(PMIDL_STUB pointer_id = NDR_LOCAL_UINT32_READ(Buffer); TRACE("pointer_id is 0x%08lx\n", pointer_id); if (!fMustAlloc && *pPointer) + { FIXME("free object pointer %p\n", *pPointer); + *pPointer = NULL; + } if (pointer_id) pointer_needs_unmarshaling = 1; else