From: <and...@us...> - 2022-12-12 20:07:19
|
Revision: 7375 http://sourceforge.net/p/nsis/code/7375 Author: anders_k Date: 2022-12-12 20:07:17 +0000 (Mon, 12 Dec 2022) Log Message: ----------- !uninstfinalize big uninstaller fixes, part 2 (bug #1279) Modified Paths: -------------- NSIS/trunk/Source/build.cpp NSIS/trunk/Source/mmap.cpp NSIS/trunk/Source/script.cpp Modified: NSIS/trunk/Source/build.cpp =================================================================== --- NSIS/trunk/Source/build.cpp 2022-12-05 21:39:46 UTC (rev 7374) +++ NSIS/trunk/Source/build.cpp 2022-12-12 20:07:17 UTC (rev 7375) @@ -3333,7 +3333,7 @@ ERROR_MSG(_T("Error: failed creating mmap of \"%") NPRIs _T("\"\n"), fpath); return PS_ERROR; } - if (add_db_data(&udata_in) < 0) + if (udata_size > NSIS_MAX_EXEFILESIZE || add_db_data(&udata_in) < 0) return PS_ERROR; assert(NSIS_MAX_EXEFILESIZE <= ~(UINT32)0); Modified: NSIS/trunk/Source/mmap.cpp =================================================================== --- NSIS/trunk/Source/mmap.cpp 2022-12-05 21:39:46 UTC (rev 7374) +++ NSIS/trunk/Source/mmap.cpp 2022-12-12 20:07:17 UTC (rev 7375) @@ -317,9 +317,9 @@ if (hFile) { if (!setfile(hFile, size)) size = 0; - // NOTE: mmap() requires the file to stay open for get(), otherwise - // get() will fail with errno code EBADFD (bad file descriptor). - //fclose(hFile); + // NOTE: mmap() requires the file descriptor to stay open for get(), + // otherwise get() will fail with errno code EBADFD (bad file descriptor). + m_hFile = hFile, m_bTempHandle = TRUE; } #endif return size; Modified: NSIS/trunk/Source/script.cpp =================================================================== --- NSIS/trunk/Source/script.cpp 2022-12-05 21:39:46 UTC (rev 7374) +++ NSIS/trunk/Source/script.cpp 2022-12-12 20:07:17 UTC (rev 7375) @@ -5322,13 +5322,13 @@ MANAGE_WITH(hFile, fclose); const int fd = fileno(hFile); #endif - if (!mmap.setfile(hFile, filesize)) + if (!mmap.setfile(hFile, filesize) && filesize) { ERROR_MSG(_T("%") NPRIs _T("File: failed creating mmap of \"%") NPRIs _T("\"\n"),generatecode?_T(""):_T("Reserve"),newfn); return PS_ERROR; } DWORD len = (DWORD) filesize; - if (len != filesize) len = 0xffffffffUL; + if (len != filesize) len = 0xffffffffUL - 1024; // truncate_cast but as large as possible if (generatecode&1) section_add_size_kb((len+1023)/1024); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |