Commit 98679974 authored by Guy Albertelli's avatar Guy Albertelli Committed by Alexandre Julliard

Added null check in GlobalHandle.

parent afa43155
......@@ -1141,7 +1141,14 @@ HGLOBAL WINAPI GlobalHandle(
LPCVOID pmem /* [in] Pointer to global memory block */
) {
HGLOBAL handle;
HANDLE heap = GLOBAL_GetHeap( POINTER_TO_HANDLE(pmem) );
HANDLE heap;
if (!pmem)
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}
heap = GLOBAL_GetHeap( POINTER_TO_HANDLE(pmem) );
if (!HEAP_IsInsideHeap( heap, 0, pmem )) goto error;
handle = POINTER_TO_HANDLE(pmem);
......
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