about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--malloc/malloc.c2
-rw-r--r--sunrpc/rpc_main.c6
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 74e1523849..197fb79944 100644
--- 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]
diff --git a/malloc/malloc.c b/malloc/malloc.c
index feca2cbea9..d6102a4528 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -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);
diff --git a/sunrpc/rpc_main.c b/sunrpc/rpc_main.c
index bda432d3cd..a3d227e524 100644
--- a/sunrpc/rpc_main.c
+++ b/sunrpc/rpc_main.c
@@ -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;