Commit 6d9d1143 authored by Alexander Yaworsky's avatar Alexander Yaworsky Committed by Alexandre Julliard

Changed allocation of arguments in SearchPathA so path is not limited

by size of TEB static buffer.
parent 578f9f5a
......@@ -819,17 +819,17 @@ DWORD WINAPI SearchPathA( LPCSTR path, LPCSTR name, LPCSTR ext,
WCHAR bufferW[MAX_PATH];
DWORD ret;
if (!(pathW = FILE_name_AtoW( path, FALSE ))) return 0;
if (name && !(nameW = FILE_name_AtoW( name, TRUE ))) return 0;
if (name && !(nameW = FILE_name_AtoW( name, FALSE ))) return 0;
if (!(pathW = FILE_name_AtoW( path, TRUE ))) return 0;
if (ext && !(extW = FILE_name_AtoW( ext, TRUE )))
{
if (nameW) HeapFree( GetProcessHeap(), 0, nameW );
HeapFree( GetProcessHeap(), 0, pathW );
return 0;
}
ret = SearchPathW(pathW, nameW, extW, MAX_PATH, bufferW, NULL);
if (nameW) HeapFree( GetProcessHeap(), 0, nameW );
HeapFree( GetProcessHeap(), 0, pathW );
if (extW) HeapFree( GetProcessHeap(), 0, extW );
if (!ret) return 0;
......
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