Commit 63a4b203 authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

Assume MAX_PATH length for pszDisplayName.

parent f7e9e5b7
...@@ -461,9 +461,9 @@ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi) ...@@ -461,9 +461,9 @@ LPITEMIDLIST WINAPI SHBrowseForFolderA (LPBROWSEINFOA lpbi)
bi.pidlRoot = lpbi->pidlRoot; bi.pidlRoot = lpbi->pidlRoot;
if (lpbi->pszDisplayName) if (lpbi->pszDisplayName)
{ {
len = MultiByteToWideChar(CP_ACP, 0, lpbi->pszDisplayName, -1, NULL, 0); /*lpbi->pszDisplayName is assumed to be MAX_PATH (MSDN) */
bi.pszDisplayName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); bi.pszDisplayName = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpbi->pszDisplayName, -1, bi.pszDisplayName, len); MultiByteToWideChar(CP_ACP, 0, lpbi->pszDisplayName, -1, bi.pszDisplayName, MAX_PATH);
} }
else else
bi.pszDisplayName = NULL; bi.pszDisplayName = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment