1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

Merge branch 'master' of ssh://sources.redhat.com/git/glibc

Conflicts:
	ChangeLog
This commit is contained in:
Ulrich Drepper
2010-03-25 19:45:20 -07:00
4 changed files with 25 additions and 2 deletions

View File

@@ -4852,7 +4852,8 @@ _int_free(mstate av, mchunkptr p)
free_perturb (chunk2mem(p), size - SIZE_SZ);
set_fastchunks(av);
fb = &fastbin (av, fastbin_index(size));
unsigned int idx = fastbin_index(size);
fb = &fastbin (av, idx);
#ifdef ATOMIC_FASTBINS
mchunkptr fd;
@@ -4866,6 +4867,12 @@ _int_free(mstate av, mchunkptr p)
errstr = "double free or corruption (fasttop)";
goto errout;
}
if (old != NULL
&& __builtin_expect (fastbin_index(chunksize(old)) != idx, 0))
{
errstr = "invalid fastbin entry (free)";
goto errout;
}
p->fd = fd = old;
}
while ((old = catomic_compare_and_exchange_val_rel (fb, p, fd)) != fd);
@@ -4877,6 +4884,12 @@ _int_free(mstate av, mchunkptr p)
errstr = "double free or corruption (fasttop)";
goto errout;
}
if (*fb != NULL
&& __builtin_expect (fastbin_index(chunksize(*fb)) != idx, 0))
{
errstr = "invalid fastbin entry (free)";
goto errout;
}
p->fd = *fb;
*fb = p;