Author: janderwald
Date: Sat Jun 28 08:40:00 2008
New Revision: 34155
URL:
http://svn.reactos.org/svn/reactos?rev=34155&view=rev
Log:
- fix a buffer overflow leading to disapperance of file type text
- introduced in rev 34133
Modified:
trunk/reactos/dll/win32/shell32/fprop.c
Modified: trunk/reactos/dll/win32/shell32/fprop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/fprop.c?…
==============================================================================
--- trunk/reactos/dll/win32/shell32/fprop.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/fprop.c [iso-8859-1] Sat Jun 28 08:40:00 2008
@@ -164,15 +164,15 @@
LPVOID pResource = NULL;
HGLOBAL hGlobal;
HANDLE hLibrary;
-
Offset = wcsrchr(name, L',');
if (Offset)
{
IconIndex = _wtoi(Offset + 2);
*Offset = L'\0';
+ name[MAX_PATH-1] = L'\0';
if (ExpandEnvironmentStringsW(name, szBuffer, MAX_PATH))
{
- szBuffer[MAX_PATH] = L'\0';
+ szBuffer[MAX_PATH-1] = L'\0';
hLibrary = LoadLibraryExW(szBuffer, NULL, LOAD_LIBRARY_AS_DATAFILE);
if (hLibrary)
{