From: Ulrich Drepper Date: Mon, 25 Oct 2010 02:37:00 +0000 (-0400) Subject: Fix perturbing in malloc on free. X-Git-Tag: glibc-2.11.3~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa55fd7e5b1da8bd2dddffab82931e2495e82435;p=thirdparty%2Fglibc.git Fix perturbing in malloc on free. (cherry picked from commit fdc0f374bcd2d0513569aa8d600f960e43e8af1d) --- diff --git a/ChangeLog b/ChangeLog index b9b347ad080..a95b1821ce4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-10-24 Ulrich Drepper + + [BZ #12140] + * malloc/malloc.c (_int_free): Fill correct number of bytes when + perturbing. + 2010-09-09 Andreas Schwab * Makeconfig (sysd-rules-patterns): Add rtld-%:rtld-%. diff --git a/malloc/malloc.c b/malloc/malloc.c index b1d43c6447c..29c79923d13 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -4850,7 +4850,7 @@ _int_free(mstate av, mchunkptr p) } if (__builtin_expect (perturb_byte, 0)) - free_perturb (chunk2mem(p), size - SIZE_SZ); + free_perturb (chunk2mem(p), size - 2 * SIZE_SZ); set_fastchunks(av); fb = &fastbin (av, fastbin_index(size)); @@ -4938,7 +4938,7 @@ _int_free(mstate av, mchunkptr p) } if (__builtin_expect (perturb_byte, 0)) - free_perturb (chunk2mem(p), size - SIZE_SZ); + free_perturb (chunk2mem(p), size - 2 * SIZE_SZ); /* consolidate backward */ if (!prev_inuse(p)) {