[MinidumpUpload] Fix crash

This commit is contained in:
momo5502 2017-01-08 22:36:50 +01:00
parent 2e4c234aa3
commit 6661c72053

View File

@ -204,7 +204,7 @@ namespace Components
strftime(filenameFriendlyTime, sizeof(filenameFriendlyTime) - 1, "%Y%m%d%H%M%S", &ltime); strftime(filenameFriendlyTime, sizeof(filenameFriendlyTime) - 1, "%Y%m%d%H%M%S", &ltime);
// Combine with queuedMinidumpsFolder // Combine with queuedMinidumpsFolder
char filename[MAX_PATH]; char filename[MAX_PATH] = { 0 };
PathCombineA(filename, MinidumpUpload::queuedMinidumpsFolder.data(), Utils::String::VA("%s-" VERSION "-%s.dmp", exeFileName, filenameFriendlyTime)); PathCombineA(filename, MinidumpUpload::queuedMinidumpsFolder.data(), Utils::String::VA("%s-" VERSION "-%s.dmp", exeFileName, filenameFriendlyTime));
// Generate the dump // Generate the dump
@ -237,7 +237,7 @@ namespace Components
// Walk through directory and search for valid minidumps // Walk through directory and search for valid minidumps
WIN32_FIND_DATAA ffd; WIN32_FIND_DATAA ffd;
HANDLE hFind = FindFirstFileA(Utils::String::VA("%s\\*.dmp", MinidumpUpload::queuedMinidumpsFolder), &ffd); HANDLE hFind = FindFirstFileA(Utils::String::VA("%s\\*.dmp", MinidumpUpload::queuedMinidumpsFolder.data()), &ffd);
if (hFind != INVALID_HANDLE_VALUE) if (hFind != INVALID_HANDLE_VALUE)
{ {
do do
@ -349,7 +349,7 @@ namespace Components
#else #else
// BitMessage has a max msg size that is somewhere around 220 KB, split it up as necessary! // BitMessage has a max msg size that is somewhere around 220 KB, split it up as necessary!
auto totalParts = compressedMinidump.size() / MinidumpUpload::maxSegmentSize + 1; auto totalParts = compressedMinidump.size() / MinidumpUpload::maxSegmentSize + 1;
extraHeaders.insert({ "Parts", Utils::String::VA("%d",totalParts) }); extraHeaders.insert({ "Parts", Utils::String::VA("%d", totalParts) });
for (size_t offset = 0; offset < compressedMinidump.size(); offset += MinidumpUpload::maxSegmentSize) for (size_t offset = 0; offset < compressedMinidump.size(); offset += MinidumpUpload::maxSegmentSize)
{ {