mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-02 12:03:45 +00:00
Added null check in GlobalHandle.
This commit is contained in:
parent
afa4315507
commit
9867997450
1 changed files with 8 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue