Index: file.c =================================================================== --- dll/win32/kernel32/file/file.c (revision 50503) +++ dll/win32/kernel32/file/file.c (working copy) @@ -80,7 +80,7 @@ ANSI_STRING str; str.Buffer = DestA; - str.MaximumLength = (USHORT)destLen; + str.MaximumLength = (USHORT) min(destLen, MAX_PATH); if (bIsFileApiAnsi)