Author: janderwald Date: Sun Jan 2 16:54:00 2011 New Revision: 50262
URL: http://svn.reactos.org/svn/reactos?rev=50262&view=rev Log: [KERNEL32] - Fix heap corruptions in MoveFileWithProgress - Fixes kernel32_winetest change crash - Introduced in rev 18073 (25.Sept 2005)
Modified: trunk/reactos/dll/win32/kernel32/file/move.c
Modified: trunk/reactos/dll/win32/kernel32/file/move.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/mov... ============================================================================== --- trunk/reactos/dll/win32/kernel32/file/move.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/file/move.c [iso-8859-1] Sun Jan 2 16:54:00 2011 @@ -418,7 +418,7 @@ /* Get the file name */ memset(&findBuffer,0,sizeof(WIN32_FIND_DATAW)); hFile = FindFirstFileW(lpExistingFileName2, &findBuffer); - if (hFile == NULL) + if (hFile == INVALID_HANDLE_VALUE) loop=FALSE;
if (findBuffer.cFileName[0] == L'\0') @@ -446,13 +446,13 @@ { size = wcslen(lpExistingFileName2)-4; FindClose(hFile); + hFile = INVALID_HANDLE_VALUE; + wcscpy( &lpExistingFileName2[size],L"\0");
if (wcsncmp(lpExistingFileName,lpExistingFileName2,size)) { DWORD Attributes; - - FindClose(hFile);
/* delete folder */ TRACE("MoveFileWithProgressW : Delete folder : %S\n",lpDeleteFile);