mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-12 14:21:18 +08:00
* malloc/malloc.c (_int_free): Further free () protection checks.
This commit is contained in:
parent
b3c20a361d
commit
a52ef8e416
@ -4233,6 +4233,14 @@ _int_free(mstate av, Void_t* mem)
|
||||
#endif
|
||||
) {
|
||||
|
||||
if (__builtin_expect (chunksize (chunk_at_offset (p, size)) < MINSIZE, 0)
|
||||
|| __builtin_expect (chunksize (chunk_at_offset (p, size))
|
||||
>= av->system_mem, 0))
|
||||
{
|
||||
errstr = "invalid next size (fast)";
|
||||
goto errout;
|
||||
}
|
||||
|
||||
set_fastchunks(av);
|
||||
fb = &(av->fastbins[fastbin_index(size)]);
|
||||
/* Another simple check: make sure the top of the bin is not the
|
||||
|
Loading…
x
Reference in New Issue
Block a user