diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 1997-03-18 07:54:24 +0000 | 
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1997-03-18 07:54:24 +0000 | 
| commit | 753da60320633bf92bb698ce3767a0d2e6d62a67 (patch) | |
| tree | fa9d9605e6b5839374e9dd5ea6a0ca6dce3ec95e /lib/libc/stdlib | |
| parent | 5f1376d7ec1f1e71d387883a0b385a3b1fae8e6a (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib')
| -rw-r--r-- | lib/libc/stdlib/malloc.c | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 6462ad164690..f1eaffe76eda 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -6,7 +6,7 @@   * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp   * ----------------------------------------------------------------------------   * - * $Id$ + * $Id: malloc.c,v 1.21 1997/02/22 15:03:12 peter Exp $   *   */ @@ -731,7 +731,9 @@ imalloc(size_t size)      if (suicide)  	abort(); -    if (size <= malloc_maxsize) +    if ((size + malloc_pagesize) < size)	/* Check for overflow */ +	result = 0; +    else if (size <= malloc_maxsize)  	result =  malloc_bytes(size);      else  	result =  malloc_pages(size); | 
