Author: fireball
Date: Fri Jan 28 20:18:07 2011
New Revision: 50543
URL:
http://svn.reactos.org/svn/reactos?rev=50543&view=rev
Log:
- Robert Horvath: Always limit destLen to MAX_PATH (modified to an if condition by me).
See issue #5861 for more details.
Modified:
trunk/reactos/dll/win32/kernel32/file/file.c
Modified: trunk/reactos/dll/win32/kernel32/file/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/fi…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/file.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/file.c [iso-8859-1] Fri Jan 28 20:18:07 2011
@@ -71,6 +71,9 @@
)
{
DWORD ret;
+
+ /* destLen should never exceed MAX_PATH */
+ if (destLen > MAX_PATH) destLen = MAX_PATH;
ret = bIsFileApiAnsi? RtlUnicodeStringToAnsiSize(SourceU) :
RtlUnicodeStringToOemSize(SourceU);
/* ret incl. nullchar */