Author: hbelusca
Date: Sat Mar 12 17:06:33 2016
New Revision: 70997
URL:
http://svn.reactos.org/svn/reactos?rev=70997&view=rev
Log:
[SHELL32]: Correctly copy the icon file name string, using the user-defined nMaxFile
parameter.
Modified:
trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp
Modified: trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dialogs/…
==============================================================================
--- trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/dialogs/dialogs.cpp [iso-8859-1] Sat Mar 12 17:06:33
2016
@@ -234,12 +234,12 @@
hLibrary = LoadLibraryExW(lpstrFile, NULL, LOAD_LIBRARY_AS_DATAFILE |
LOAD_LIBRARY_AS_IMAGE_RESOURCE);
IconContext.hLibrary = hLibrary;
IconContext.Index = *lpdwIconIndex;
- wcscpy(IconContext.szName, lpstrFile);
+ StringCchCopyNW(IconContext.szName, ARRAYSIZE(IconContext.szName), lpstrFile,
nMaxFile);
res = DialogBoxParamW(shell32_hInstance, MAKEINTRESOURCEW(IDD_PICK_ICON), hwndOwner,
PickIconProc, (LPARAM)&IconContext);
if (res)
{
- wcscpy(lpstrFile, IconContext.szName);
+ StringCchCopyNW(lpstrFile, nMaxFile, IconContext.szName,
ARRAYSIZE(IconContext.szName));
*lpdwIconIndex = IconContext.Index;
}