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.

svn path=/trunk/; revision=36816
This commit is contained in:
Colin Finck 2008-10-18 22:22:09 +00:00
parent eb2c5f864c
commit c9a04929cc

View file

@ -50,7 +50,7 @@ PWCHAR GetNthChildKeyName( HANDLE RegHandle, DWORD n ) {
}
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)