wininet: Set uninitialized memmory to 0xdeadbeef in cache files.

This commit is contained in:
Piotr Caban 2012-04-03 16:46:07 +02:00 committed by Alexandre Julliard
parent edcc395dac
commit e4ad164f6e
1 changed files with 3 additions and 0 deletions

View File

@ -811,6 +811,8 @@ static BOOL URLCache_FindFirstFreeEntry(URLCACHE_HEADER * pHeader, DWORD dwBlock
for (index = 0; index < dwBlocksNeeded; index++) for (index = 0; index < dwBlocksNeeded; index++)
URLCache_Allocation_BlockAllocate(AllocationTable, dwBlockNumber + index); URLCache_Allocation_BlockAllocate(AllocationTable, dwBlockNumber + index);
*ppEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + ENTRY_START_OFFSET + dwBlockNumber * BLOCKSIZE); *ppEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + ENTRY_START_OFFSET + dwBlockNumber * BLOCKSIZE);
for (index = 0; index < dwBlocksNeeded * BLOCKSIZE / sizeof(DWORD); index++)
((DWORD*)*ppEntry)[index] = 0xdeadbeef;
(*ppEntry)->dwBlocksUsed = dwBlocksNeeded; (*ppEntry)->dwBlocksUsed = dwBlocksNeeded;
return TRUE; return TRUE;
} }
@ -1398,6 +1400,7 @@ static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_
pHeader->dwOffsetFirstHashTable = dwOffset; pHeader->dwOffsetFirstHashTable = dwOffset;
(*ppHash)->CacheFileEntry.dwSignature = HASH_SIGNATURE; (*ppHash)->CacheFileEntry.dwSignature = HASH_SIGNATURE;
(*ppHash)->CacheFileEntry.dwBlocksUsed = 0x20; (*ppHash)->CacheFileEntry.dwBlocksUsed = 0x20;
(*ppHash)->dwAddressNext = 0;
(*ppHash)->dwHashTableNumber = pPrevHash ? pPrevHash->dwHashTableNumber + 1 : 0; (*ppHash)->dwHashTableNumber = pPrevHash ? pPrevHash->dwHashTableNumber + 1 : 0;
for (i = 0; i < HASHTABLE_SIZE; i++) for (i = 0; i < HASHTABLE_SIZE; i++)
{ {