public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Fix memcpy bug that reads past end of buffer.
@ 2016-01-28 22:09 Steve Ellcey
  0 siblings, 0 replies; only message in thread
From: Steve Ellcey @ 2016-01-28 22:09 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4792146a0f20d23be523b5b57be6f037c0c9c00d

commit 4792146a0f20d23be523b5b57be6f037c0c9c00d
Author: Steve Ellcey <sellcey@imgtec.com>
Date:   Thu Jan 28 14:08:35 2016 -0800

    Fix memcpy bug that reads past end of buffer.
    
    	* libc/machine/mips/memcpy.S (memcpy): Fix read past end of
    	input.

Diff:
---
 newlib/libc/machine/mips/memcpy.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/machine/mips/memcpy.S b/newlib/libc/machine/mips/memcpy.S
index 3130f6e..21bd3b4 100644
--- a/newlib/libc/machine/mips/memcpy.S
+++ b/newlib/libc/machine/mips/memcpy.S
@@ -581,11 +581,11 @@ L(lastw):
 #ifdef USE_DOUBLE
 	andi    t8,a2,3		/* a2 is the remainder past 4 byte chunks.  */
 	beq	t8,a2,L(lastb)
+	move	a2,t8
 	lw	REG3,0(a1)
 	sw	REG3,0(a0)
 	PTR_ADDIU a0,a0,4
 	PTR_ADDIU a1,a1,4
-	move	a2,t8
 #endif
 
 /* Copy the last 8 (or 16) bytes */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-28 22:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 22:09 [newlib-cygwin] Fix memcpy bug that reads past end of buffer Steve Ellcey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).