This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raise size cap when reading process environment. Fixes #2459
- Loading branch information
Showing
1 changed file
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -494,7 +494,8 @@ private static Dictionary<string, string> GetEnvironmentVariablesCore(IntPtr hPr | |
throw new Win32Exception("Unable to read environment block."); | ||
} | ||
|
||
const int maxEnvSize = 32767; | ||
// Limit env size to 10 MB to be defensive | ||
const int maxEnvSize = 10 * 1000 * 1000; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
davidfowl
Member
|
||
if (dataSize > maxEnvSize) | ||
{ | ||
dataSize = maxEnvSize; | ||
|
thanks. nit: 10 * 1024 *1024 would be slight more accurate.