Commit 962d8b60 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: Cope with a realloc returning a different pointer.

parent 2d50aa36
......@@ -56,7 +56,7 @@ typedef struct {
DWORD SpyedAllocationsLeft; /* number of spyed allocations left */
BOOL SpyReleasePending; /* CoRevokeMallocSpy called with spyed allocations left*/
LPVOID * SpyedBlocks; /* root of the table */
int SpyedBlockTableLength; /* size of the table*/
DWORD SpyedBlockTableLength;/* size of the table*/
} _Malloc32;
/* this is the static object instance */
......@@ -73,7 +73,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
/* resize the old table */
static int SetSpyedBlockTableLength ( int NewLength )
static int SetSpyedBlockTableLength ( DWORD NewLength )
{
LPVOID *NewSpyedBlocks;
......@@ -103,7 +103,9 @@ static int AddMemoryLocation(LPVOID * pMem)
Current++;
if (Current >= Malloc32.SpyedBlocks + Malloc32.SpyedBlockTableLength) {
/* no more space in table, grow it */
DWORD old_length = Malloc32.SpyedBlockTableLength;
if (!SetSpyedBlockTableLength( Malloc32.SpyedBlockTableLength + 0x1000 )) return 0;
Current = Malloc32.SpyedBlocks + old_length;
}
};
......
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