Commit d8fc23d8 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

kernelbase: Validate nonzero size for MEM_RELEASE in VirtualFreeEx().

parent 1d3c0d73
......@@ -457,6 +457,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH VirtualFree( void *addr, SIZE_T size, DWORD type )
*/
BOOL WINAPI DECLSPEC_HOTPATCH VirtualFreeEx( HANDLE process, void *addr, SIZE_T size, DWORD type )
{
if (type == MEM_RELEASE && size)
{
WARN( "Trying to release memory with specified size.\n" );
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
return set_ntstatus( NtFreeVirtualMemory( process, &addr, &size, type ));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment