]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* malloc/malloc.c (public_rEALLOc): When new arena is used, copy
authorUlrich Drepper <drepper@redhat.com>
Mon, 3 Nov 2008 08:07:39 +0000 (08:07 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 3 Nov 2008 08:07:39 +0000 (08:07 +0000)
really all bytes.  Patch by Denys Vlasenko <dvlasenk@redhat.com>.

ChangeLog
malloc/malloc.c
sunrpc/rpc_main.c

index 74e1523849a5d4e2e8b97f357288f566929f6212..197fb7994493868553a8a0d323558438f1a1b721 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-02  Ulrich Drepper  <drepper@redhat.com>
+
+       * malloc/malloc.c (public_rEALLOc): When new arena is used, copy
+       really all bytes.  Patch by Denys Vlasenko <dvlasenk@redhat.com>.
+
 2008-11-01  Ulrich Drepper  <drepper@redhat.com>
 
        [BZ #6966]
index feca2cbea9db0ad1f9763c101f1da580980367cd..d6102a4528f8f2b8ea7a9e933512aff8aeb8596d 100644 (file)
@@ -3717,7 +3717,7 @@ public_rEALLOc(Void_t* oldmem, size_t bytes)
       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);
index bda432d3cd0f2f1ac613687a569107d5a3d0e0f6..a3d227e524ca7d45c585a83e9e14f7de1fc33f02 100644 (file)
@@ -995,7 +995,11 @@ mkfile_output (struct commandline *cmd)
        abort ();
       temp = rindex (cmd->infile, '.');
       cp = stpcpy (mkfilename, "Makefile.");
-      strncpy (cp, cmd->infile, (temp - cmd->infile));
+      if (temp != NULL)
+       *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
+      else
+       stpcpy (cp, cmd->infile);
+
     }
   else
     mkfilename = (char *) cmd->outfile;