diff options
author | Ladislav <Zezula> | 2013-12-15 10:29:50 +0100 |
---|---|---|
committer | Ladislav <Zezula> | 2013-12-15 10:29:50 +0100 |
commit | fe51da468be9ca0963192c5f3a1705562bc957ba (patch) | |
tree | 767edeed5f8cd2b4561317724efdb2d1b2547d7b /src/SBaseCommon.cpp | |
parent | 6961cd51b65e8df7f807e25ab6ffc4da8c205449 (diff) |
+ static analysis issues fixed
Diffstat (limited to 'src/SBaseCommon.cpp')
-rw-r--r-- | src/SBaseCommon.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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; |