Bruno Jesus : kernel32: Limit the environment variable size to 32767 in GetEnvironmentVariable.
Alexandre Julliard
julliard at winehq.org
Thu Jun 12 15:51:43 CDT 2014
Module: wine
Branch: master
Commit: 515b8bebb6dfdf173f65beda6eb5f62f7e84c87d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=515b8bebb6dfdf173f65beda6eb5f62f7e84c87d
Author: Bruno Jesus <00cpxxx at gmail.com>
Date: Fri May 30 21:59:08 2014 -0300
kernel32: Limit the environment variable size to 32767 in GetEnvironmentVariable.
---
dlls/kernel32/environ.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/kernel32/environ.c b/dlls/kernel32/environ.c
index b6b3124..14283f8 100644
--- a/dlls/kernel32/environ.c
+++ b/dlls/kernel32/environ.c
@@ -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;
More information about the wine-cvs
mailing list