Author: cfinck Date: Sat Oct 18 17:22:09 2008 New Revision: 36816
URL: http://svn.reactos.org/svn/reactos?rev=36816&view=rev Log: Allocate enough memory for Value (problem was spotted by Pigglesworth) This problem was revealed by r36797 (thanks to aicom, elhoir, Lone_Rifle and vicmarcal for the help with regression testing)
Fixes ipconfig, ping and other network apps crashing with a buffer overflow.
Modified: trunk/reactos/dll/win32/iphlpapi/registry.c
Modified: trunk/reactos/dll/win32/iphlpapi/registry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/registry... ============================================================================== --- trunk/reactos/dll/win32/iphlpapi/registry.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/registry.c [iso-8859-1] Sat Oct 18 17:22:09 2008 @@ -50,7 +50,7 @@ }
ValueLen = MaxAdapterName; - Value = (PWCHAR)HeapAlloc( GetProcessHeap(), 0, MaxAdapterName ); + Value = (PWCHAR)HeapAlloc( GetProcessHeap(), 0, MaxAdapterName * sizeof(WCHAR) ); Status = RegEnumKeyExW( RegHandle, n, Value, &ValueLen, NULL, NULL, NULL, NULL ); if (Status != ERROR_SUCCESS)