Index: src/ch/FileInfo.h =================================================================== diff -u -rc57e6817d7236fcc47538c09cf9cfaac0fbfbfe7 -r34a693d8a44eeb16c2c2d071a29678dcbd2febb1 --- src/ch/FileInfo.h (.../FileInfo.h) (revision c57e6817d7236fcc47538c09cf9cfaac0fbfbfe7) +++ src/ch/FileInfo.h (.../FileInfo.h) (revision 34a693d8a44eeb16c2c2d071a29678dcbd2febb1) @@ -261,6 +261,14 @@ { INT_PTR iSize; ar>>iSize; + + // workaround for a problem, where '0' was stored as int instead of INT_PTR; + // in this case on x86_64 iSize could have some enormous size (because we read + // someone else's data following the int value. + // Try to avoid reading later some invalid data (since we have stolen 4 bytes on x86_64). + if(iSize > INT_MAX) + THROW(_T("[CFileInfoArray::Load()] Corrupted task data (bug [#sf:2905339]"), 0, 0, 0); + SetSize(iSize, 5000); CFileInfo fi; fi.SetClipboard(&m_rClipboard); Index: src/ch/MainWnd.cpp =================================================================== diff -u -r59c39dd19e2c42f33189ee07274f0488d54d7ed0 -r34a693d8a44eeb16c2c2d071a29678dcbd2febb1 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 59c39dd19e2c42f33189ee07274f0488d54d7ed0) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 34a693d8a44eeb16c2c2d071a29678dcbd2febb1) @@ -171,6 +171,7 @@ m_tasks.Create(m_pFeedbackFactory); // load last state + LOG_INFO(_T("Loading existing tasks...")); CString strPath; GetApp().GetProgramDataPath(strPath); strPath += _T("\\Tasks\\"); @@ -179,6 +180,7 @@ m_tasks.TasksRetryProcessing(); // start clipboard monitoring + LOG_INFO(_T("Starting clipboard monitor...")); CClipboardMonitor::StartMonitor(&m_tasks); EUpdatesFrequency eFrequency = (EUpdatesFrequency)GetConfig().get_unsigned_num(PP_PCHECK_FOR_UPDATES_FREQUENCY); @@ -214,6 +216,8 @@ // perform checking for updates only when the minimal interval has passed if(ullCurrentStamp - ullTimestamp >= ullMinInterval) { + LOG_INFO(_T("Checking for updates...")); + CUpdaterDlg* pDlg = new CUpdaterDlg(true); pDlg->m_bAutoDelete = true; Index: src/ch/task.cpp =================================================================== diff -u -r2457755b4084e3d1c80a8e7c77c9f0996312941b -r34a693d8a44eeb16c2c2d071a29678dcbd2febb1 --- src/ch/task.cpp (.../task.cpp) (revision 2457755b4084e3d1c80a8e7c77c9f0996312941b) +++ src/ch/task.cpp (.../task.cpp) (revision 34a693d8a44eeb16c2c2d071a29678dcbd2febb1) @@ -575,7 +575,7 @@ if (GetStatus(ST_STEP_MASK) > ST_SEARCHING) m_files.Store(ar, false); else - ar<(0); + ar<(0); m_dpDestPath.Serialize(ar); ar<SetCurrentCopy(j); for (int i=pTask->GetCurrentIndex();iSetCurrentIndex(i); - CFileInfo& fi=pTask->FilesGetAtCurrentIndex(); - // should we kill ? if (pTask->GetKillFlag()) { @@ -2306,6 +2306,10 @@ throw new CProcessingException(E_KILL_REQUEST, pTask); } + // update m_nCurrentIndex, getting current CFileInfo + pTask->SetCurrentIndex(i); + CFileInfo& fi=pTask->FilesGetAtCurrentIndex(); + // set dest path with filename ccp.strDstFile=fi.GetDestinationPath(dpDestPath.GetPath(), j, ((int)bForceDirectories) << 1 | (int)bIgnoreFolders);