This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] fix a case of realloc not copying entire block (RH bug457508)
- From: Denys Vlasenko <dvlasenk at redhat dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 19 Aug 2008 10:58:34 +0200
- Subject: [PATCH] fix a case of realloc not copying entire block (RH bug457508)
Even though I failed to reproduce it, the patch looks obviously correct.
The reporter tested it and he says that this patch fixes the problem.
Details are at https://bugzilla.redhat.com/show_bug.cgi?id=457508
Please apply.
for libc/Changelog:
2008-08-19 Denys Vlasenko <dvlasenk@redhat.com>
* malloc/malloc.c (public_rEALLOc): Fix a case of realloc
not copying entire block.
--
vda
--- libc/malloc/malloc.c 2008-03-04 19:36:04.000000000 +0100
+++ libc/malloc/malloc.c 2008-08-14 18:43:22.000000000 +0200
@@ -3717,7 +3717,7 @@ public_rEALLOc(Void_t* oldmem, size_t by
newp = public_mALLOc(bytes);
if (newp != NULL)
{
- MALLOC_COPY (newp, oldmem, oldsize - 2 * SIZE_SZ);
+ MALLOC_COPY (newp, oldmem, oldsize - SIZE_SZ);
#if THREAD_STATS
if(!mutex_trylock(&ar_ptr->mutex))
++(ar_ptr->stat_lock_direct);