1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00
* malloc/malloc.c (_int_free): Add cheap test for some invalid
	block sizes.
This commit is contained in:
Ulrich Drepper
2003-08-19 09:30:22 +00:00
parent 75f2e0d109
commit 9a3a9dd8d9
2 changed files with 10 additions and 0 deletions

View File

@@ -4131,6 +4131,13 @@ _int_free(mstate av, Void_t* mem)
p = mem2chunk(mem);
size = chunksize(p);
/* Little security check which won't hurt performance: the
allocator never wrapps around at the end of the address space.
Therefore we can exclude some size values which might appear
here by accident or by "design" from some intruder. */
if ((uintptr_t) p > (uintptr_t) -size)
return;
check_inuse_chunk(av, p);
/*