diff --git "a/dll/win32/comdlg32/filedlg.c" "b/dll/win32/comdlg32/filedlg.c" index 0adb3357b3a..b55e65e27bc 100644 --- "a/dll/win32/comdlg32/filedlg.c" +++ "b/dll/win32/comdlg32/filedlg.c" @@ -754,6 +754,11 @@ void COMDLG32_GetCanonicalPath(PCIDLIST_ABSOLUTE pidlAbsCurrent, { WCHAR lpstrTemp[MAX_PATH]; +#ifdef __REACTOS__ // CORE-15288 + if (lstrlenW(lpstrFile) > MAX_PATH) + lpstrFile[MAX_PATH - 2] = UNICODE_NULL; +#endif + /* Get the current directory name */ if (!COMDLG32_GetDisplayNameOf(pidlAbsCurrent, lpstrPathAndFile)) { @@ -3124,6 +3129,14 @@ BOOL FILEDLG95_OnOpen(HWND hwnd) TRACE("count=%u len=%u file=%s\n", nFileCount, sizeUsed, debugstr_w(lpstrFileList)); +#ifdef __REACTOS__ // CORE-15288 + if (sizeUsed >= MAX_PATH) + { + /* Clear the bad text in the filename dialog box */ + SendMessageA(fodInfos->DlgInfos.hwndFileName, WM_SETTEXT, 0, (LPARAM)""); + } +#endif + /* Step 1: Build a complete path name from the current folder and the filename or path in the edit box.