Michael Stefaniuc : ole32: Return the buffer pointer when WdtpInterfacePointer_UserMarshal fails.
Module: wine Branch: master Commit: 514951cc1107c1207875809f802d937b9888f93c URL: http://source.winehq.org/git/wine.git/?a=commit;h=514951cc1107c1207875809f80... Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Jan 19 11:26:14 2015 +0100 ole32: Return the buffer pointer when WdtpInterfacePointer_UserMarshal fails. Found by PVS-Studio. --- dlls/ole32/tests/usrmarshal.c | 1 + dlls/ole32/usrmarshal.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/tests/usrmarshal.c b/dlls/ole32/tests/usrmarshal.c index 8bcec74..086760e 100644 --- a/dlls/ole32/tests/usrmarshal.c +++ b/dlls/ole32/tests/usrmarshal.c @@ -576,6 +576,7 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx) ok(size == 0, "size should be 0 bytes, not %d\n", size); buffer = HeapAlloc(GetProcessHeap(), 0, size); buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, ctx, buffer, unk, &IID_IUnknown); + ok(buffer_end == buffer, "buffer_end %p buffer %p\n", buffer_end, buffer); HeapFree(GetProcessHeap(), 0, buffer); /* Now for a non-NULL pointer. The marshalled data are two size DWORDS and then diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c index 9c877b4..6687ac2 100644 --- a/dlls/ole32/usrmarshal.c +++ b/dlls/ole32/usrmarshal.c @@ -1641,7 +1641,7 @@ unsigned char * WINAPI WdtpInterfacePointer_UserMarshal(ULONG *pFlags, ULONG Rea if(CoMarshalInterface(stm, riid, punk, LOWORD(RealFlags), NULL, MSHLFLAGS_NORMAL) != S_OK) { IStream_Release(stm); - return NULL; + return pBuffer; } ALIGN_POINTER(pBuffer, 3);
participants (1)
-
Alexandre Julliard