From fe51da468be9ca0963192c5f3a1705562bc957ba Mon Sep 17 00:00:00 2001 From: Ladislav Date: Sun, 15 Dec 2013 10:29:50 +0100 Subject: + static analysis issues fixed --- src/SBaseCommon.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/SBaseCommon.cpp') diff --git a/src/SBaseCommon.cpp b/src/SBaseCommon.cpp index a0e789b..bb580b5 100644 --- a/src/SBaseCommon.cpp +++ b/src/SBaseCommon.cpp @@ -371,6 +371,7 @@ DWORD DetectFileKeyByKnownContent(void * pvFileContent, DWORD nDwords, ...) // We need at least two DWORDS to detect the file key if(nDwords < 0x02 || nDwords > 0x10) return 0; + memset(dwDecrypted, 0, sizeof(dwDecrypted)); va_start(argList, nDwords); for(i = 0; i < nDwords; i++) @@ -639,7 +640,7 @@ ULONGLONG FindFreeMpqSpace(TMPQArchive * ha) { TMPQHeader * pHeader = ha->pHeader; TFileEntry * pFileTableEnd = ha->pFileTable + ha->dwFileTableSize; - TFileEntry * pFileEntry = ha->pFileTable; + TFileEntry * pFileEntry; ULONGLONG FreeSpacePos = ha->pHeader->dwHeaderSize; DWORD dwChunkCount; @@ -952,7 +953,7 @@ int AllocateSectorOffsets(TMPQFile * hf, bool bLoadFromFile) __LoadSectorOffsets: // Allocate the sector offset table - hf->SectorOffsets = (DWORD *)STORM_ALLOC(BYTE, dwSectorOffsLen); + hf->SectorOffsets = STORM_ALLOC(DWORD, (dwSectorOffsLen / sizeof(DWORD))); if(hf->SectorOffsets == NULL) return ERROR_NOT_ENOUGH_MEMORY; -- cgit v1.2.3