Commit 17eb6f44 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Print an error if stub buffer pointer is passed into safe_copy_from_buffer.

Also print an error message if there was an overflow.
parent 72c5aea6
......@@ -664,7 +664,13 @@ static inline void safe_copy_from_buffer(MIDL_STUB_MESSAGE *pStubMsg, void *p, U
{
if ((pStubMsg->Buffer + size < pStubMsg->Buffer) || /* integer overflow of pStubMsg->Buffer */
(pStubMsg->Buffer + size > pStubMsg->BufferEnd))
{
ERR("buffer overflow - Buffer = %p, BufferEnd = %p, size = %u\n",
pStubMsg->Buffer, pStubMsg->BufferEnd, size);
RpcRaiseException(RPC_X_BAD_STUB_DATA);
}
if (p == pStubMsg->Buffer)
ERR("pointer is the same as the buffer\n");
memcpy(p, pStubMsg->Buffer, size);
pStubMsg->Buffer += 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