From ec558397a779945e2591fe53a472e2a76b2b994f Mon Sep 17 00:00:00 2001 From: deepzero Date: Sat, 8 Mar 2014 14:36:54 +0100 Subject: [PATCH] fix uninitialized pointer --- TitanEngine/TitanEngine.Breakpoints.cpp | 2 +- TitanEngine/TitanEngine.Debugger.Memory.cpp | 4 ++-- TitanEngine/TitanEngine.Static.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TitanEngine/TitanEngine.Breakpoints.cpp b/TitanEngine/TitanEngine.Breakpoints.cpp index 5cd1ce8..04645db 100644 --- a/TitanEngine/TitanEngine.Breakpoints.cpp +++ b/TitanEngine/TitanEngine.Breakpoints.cpp @@ -152,7 +152,7 @@ __declspec(dllexport) bool TITCALL DisableBPX(ULONG_PTR bpxAddress) __declspec(dllexport) bool TITCALL SetBPX(ULONG_PTR bpxAddress, DWORD bpxType, LPVOID bpxCallBack) { MutexLocker lock("BreakPointBuffer"); - void* bpxDataPrt; + void* bpxDataPrt=NULL; PMEMORY_COMPARE_HANDLER bpxDataCmpPtr; MEMORY_BASIC_INFORMATION MemInfo; ULONG_PTR NumberOfBytesReadWritten = 0; diff --git a/TitanEngine/TitanEngine.Debugger.Memory.cpp b/TitanEngine/TitanEngine.Debugger.Memory.cpp index 394f039..10ebfda 100644 --- a/TitanEngine/TitanEngine.Debugger.Memory.cpp +++ b/TitanEngine/TitanEngine.Debugger.Memory.cpp @@ -7,8 +7,8 @@ __declspec(dllexport) bool TITCALL MatchPatternEx(HANDLE hProcess, void* MemoryT { if(!MemoryToCheck || !PatternToMatch) return false; - int i = NULL; - BYTE intWildCard = NULL; + int i = 0; + BYTE intWildCard = 0; LPVOID ueReadBuffer = NULL; ULONG_PTR ueNumberOfBytesRead = NULL; MEMORY_BASIC_INFORMATION memoryInformation = {}; diff --git a/TitanEngine/TitanEngine.Static.cpp b/TitanEngine/TitanEngine.Static.cpp index a98fd3f..6416b9f 100644 --- a/TitanEngine/TitanEngine.Static.cpp +++ b/TitanEngine/TitanEngine.Static.cpp @@ -605,18 +605,18 @@ __declspec(dllexport) bool TITCALL StaticRawMemoryCopyExW(HANDLE hFile, DWORD Ra WriteFile(hWriteFile, ueCopyBuffer, rfNumberOfBytesRead, &rfNumberOfBytesRead, NULL); } SizeToRead = Size; - Size = NULL; + Size = 0; } else { SizeToRead = Size; - Size = NULL; + Size = 0; } } else { WriteFile(hWriteFile, ueCopyBuffer, rfNumberOfBytesRead, &rfNumberOfBytesRead, NULL); - Size = NULL; + Size = 0; } } EngineCloseHandle(hReadFile);