- Robert Horvath: Always limit destLen to MAX_PATH (modified to an if condition by me).

See issue #5861 for more details.

svn path=/trunk/; revision=50543
This commit is contained in:
Aleksey Bragin
2011-01-28 20:18:07 +00:00
parent 2e9e41d857
commit 0c53866f7f
+3
View File
@@ -72,6 +72,9 @@ FilenameU2A_FitOrFail(
{
DWORD ret;
/* destLen should never exceed MAX_PATH */
if (destLen > MAX_PATH) destLen = MAX_PATH;
ret = bIsFileApiAnsi? RtlUnicodeStringToAnsiSize(SourceU) : RtlUnicodeStringToOemSize(SourceU);
/* ret incl. nullchar */