Commit 4bde42aa authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Use abrtitrary pointer identifiers when marshalling pointers instead of…

rpcrt4: Use abrtitrary pointer identifiers when marshalling pointers instead of using pointer values. This ensures that no information about the server memory layout is leaked to clients.
parent 6cf9e441
......@@ -110,6 +110,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
ERR("buffer overflow %d bytes\n", _Msg->Buffer - ((unsigned char *)_Msg->RpcMsg->Buffer + _Msg->BufferLength)); \
} while (0)
#define NDR_POINTER_ID_BASE 0x20000
#define NDR_POINTER_ID(pStubMsg) (NDR_POINTER_ID_BASE + ((pStubMsg)->UniquePtrCount++) * 4)
#define NDR_TABLE_SIZE 128
#define NDR_TABLE_MASK 127
......@@ -1221,7 +1223,7 @@ static void PointerMarshall(PMIDL_STUB_MESSAGE pStubMsg,
pointer_needs_marshaling = 1;
else
pointer_needs_marshaling = 0;
pointer_id = (ULONG)Pointer;
pointer_id = Pointer ? NDR_POINTER_ID(pStubMsg) : 0;
TRACE("writing 0x%08x to buffer\n", pointer_id);
NDR_LOCAL_UINT32_WRITE(Buffer, pointer_id);
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment