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

Alexandre Julliard julliard at winehq.org
Tue Apr 3 12:17:40 CDT 2012


Module: wine
Branch: master
Commit: e4ad164f6e2b66c26a96c83b593e2b8684369459
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e4ad164f6e2b66c26a96c83b593e2b8684369459

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Apr  3 16:46:07 2012 +0200

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

---

 dlls/wininet/urlcache.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c
index 3a404c8..f5fcf10 100644
--- a/dlls/wininet/urlcache.c
+++ b/dlls/wininet/urlcache.c
@@ -811,6 +811,8 @@ static BOOL URLCache_FindFirstFreeEntry(URLCACHE_HEADER * pHeader, DWORD dwBlock
             for (index = 0; index < dwBlocksNeeded; index++)
                 URLCache_Allocation_BlockAllocate(AllocationTable, dwBlockNumber + index);
             *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;
             return TRUE;
         }
@@ -1398,6 +1400,7 @@ static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_
         pHeader->dwOffsetFirstHashTable = dwOffset;
     (*ppHash)->CacheFileEntry.dwSignature = HASH_SIGNATURE;
     (*ppHash)->CacheFileEntry.dwBlocksUsed = 0x20;
+    (*ppHash)->dwAddressNext = 0;
     (*ppHash)->dwHashTableNumber = pPrevHash ? pPrevHash->dwHashTableNumber + 1 : 0;
     for (i = 0; i < HASHTABLE_SIZE; i++)
     {




More information about the wine-cvs mailing list