Commit 6382c8af authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Don't use BufferEnd in RpcStream_Write.

It is usually used during marshalling, where pStubMsg->BufferStart and pStubMsg->BufferEnd won't be valid. Replace it with a check using RpcMsg->Buffer and pStubMsg->BufferLength.
parent c49a73b8
......@@ -82,7 +82,7 @@ typedef struct RpcStreamImpl
DWORD RefCount;
PMIDL_STUB_MESSAGE pMsg;
LPDWORD size;
char *data;
unsigned char *data;
DWORD pos;
} RpcStreamImpl;
......@@ -145,7 +145,7 @@ static HRESULT WINAPI RpcStream_Write(LPSTREAM iface,
ULONG *pcbWritten)
{
RpcStreamImpl *This = (RpcStreamImpl *)iface;
if (This->data + cb > (char *)This->pMsg->BufferEnd)
if (This->data + cb > (unsigned char *)This->pMsg->RpcMsg->Buffer + This->pMsg->BufferLength)
return STG_E_MEDIUMFULL;
memcpy(This->data + This->pos, pv, cb);
This->pos += cb;
......@@ -215,7 +215,7 @@ static LPSTREAM RpcStream_Create(PMIDL_STUB_MESSAGE pStubMsg, BOOL init)
This->RefCount = 1;
This->pMsg = pStubMsg;
This->size = (LPDWORD)pStubMsg->Buffer;
This->data = (char*)(This->size + 1);
This->data = (unsigned char*)(This->size + 1);
This->pos = 0;
if (init) *This->size = 0;
TRACE("init size=%d\n", *This->size);
......
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