Commit 515b8beb authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

kernel32: Limit the environment variable size to 32767 in GetEnvironmentVariable.

parent b6d0df6a
......@@ -176,6 +176,8 @@ DWORD WINAPI GetEnvironmentVariableA( LPCSTR name, LPSTR value, DWORD size )
return 0;
}
/* limit the size to sane values */
size = min(size, 32767);
if (!(valueW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR))))
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