Changeset 12356


Ignore:
Timestamp:
Nov 18, 1999, 10:21:34 AM (25 years ago)
Author:
bird
Message:

Added pointer check on lpMem in OS2Heap::Free. (This solved the WinZip 7.0
crash.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/kernel32/os2heap.cpp

    r11991 r12356  
    1 /* $Id: os2heap.cpp,v 1.12 1999-10-22 18:07:21 sandervl Exp $ */
     1/* $Id: os2heap.cpp,v 1.13 1999-11-18 09:21:34 bird Exp $ */
    22
    33/*
     
    88 *
    99 * NOTE: ReAlloc allocates memory using Alloc if memory pointer == NULL
    10  *       WINE controls depend on this, even though it apparently 
     10 *       WINE controls depend on this, even though it apparently
    1111 *       doesn't work like this in Windows.
    1212 *
     
    2626#include "misc.h"
    2727#include "vmutex.h"
     28#include "initterm.h"
    2829
    2930#ifndef HEAP_NO_SERIALIZE
     
    265266
    266267  if (dwBytes == 0) return NULL;         // intercept stupid parameters
    267  
     268
    268269  //NOTE: Allocate memory using Alloc -> WINE controls depend on this, even
    269270  //      though it apparently doesn't work in Windows.
     
    300301    dprintf(("OS2Heap::Free lpMem == NULL\n"));
    301302    return(FALSE);
     303  }
     304  /* verify lpMem address */
     305  if (lpMem >= (LPVOID)ulMaxAddr || lpMem < (LPVOID)0x10000)
     306  {
     307    dprintf(("OS2Heap::Free ERROR BAD HEAP POINTER:%X\n", lpMem));
     308    return FALSE;
    302309  }
    303310
Note: See TracChangeset for help on using the changeset viewer.