kernel32: Limit the environment variable size to 32767 in GetEnvironmentVariable.
This commit is contained in:
parent
b6d0df6a31
commit
515b8bebb6
@ -176,6 +176,8 @@ DWORD WINAPI GetEnvironmentVariableA( LPCSTR name, LPSTR value, DWORD size )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* limit the size to sane values */
|
||||||
|
size = min(size, 32767);
|
||||||
if (!(valueW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR))))
|
if (!(valueW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR))))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user