Merge remote-tracking branch 'origin/maint-0.2.2'

This commit is contained in:
Nick Mathewson 2011-09-20 10:25:56 -04:00
commit 40288e1e66
2 changed files with 6 additions and 1 deletions

5
changes/bug4059 Normal file
View File

@ -0,0 +1,5 @@
o Minor bugfixes:
- Change an integer overflow check in the OpenBSD_Malloc code so
that GCC is less likely to eliminate it as impossible. Patch
from Mansour Moufid. Fixes bug 4059.

View File

@ -1236,7 +1236,7 @@ imalloc(size_t size)
ptralloc = 1;
size = malloc_pagesize;
}
if ((size + malloc_pagesize) < size) { /* Check for overflow */
if (size > SIZE_MAX - malloc_pagesize) { /* Check for overflow */
result = NULL;
errno = ENOMEM;
} else if (size <= malloc_maxsize)