about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/strcpy-ssse3.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-07-21 12:32:36 -0400
committerUlrich Drepper <drepper@gmail.com>2011-07-21 12:32:36 -0400
commit21137f89c574de2cadda332ad874b2e6b624f950 (patch)
treece590a19201cbd8d198c9e1dd594dd8449c0b748 /sysdeps/x86_64/multiarch/strcpy-ssse3.S
parenta65c0b7a322d0084672bc7fc4b51af8f2a054d57 (diff)
downloadglibc-21137f89c574de2cadda332ad874b2e6b624f950.tar.gz
glibc-21137f89c574de2cadda332ad874b2e6b624f950.tar.xz
glibc-21137f89c574de2cadda332ad874b2e6b624f950.zip
Fix overflow bug is optimized strncat for x86-64
Diffstat (limited to 'sysdeps/x86_64/multiarch/strcpy-ssse3.S')
-rw-r--r--sysdeps/x86_64/multiarch/strcpy-ssse3.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/x86_64/multiarch/strcpy-ssse3.S b/sysdeps/x86_64/multiarch/strcpy-ssse3.S
index 05faf0dfc2..c4ec54cd21 100644
--- a/sysdeps/x86_64/multiarch/strcpy-ssse3.S
+++ b/sysdeps/x86_64/multiarch/strcpy-ssse3.S
@@ -84,10 +84,10 @@ ENTRY (STRCPY)
 
 # ifdef USE_AS_STRNCPY
 	mov	%rcx, %rsi
+	sub	$16, %r8
 	and	$0xf, %rsi
 
 /* add 16 bytes rcx_shift to r8 */
-
 	add	%rsi, %r8
 # endif
 	lea	16(%rcx), %rsi
@@ -120,7 +120,7 @@ ENTRY (STRCPY)
 /* rax = 0: there isn't end of string from position rsi to rsi+15 */
 
 # ifdef USE_AS_STRNCPY
-	sub	$32, %r8
+	sub	$16, %r8
 	jbe	L(CopyFrom1To16BytesCase2OrCase3)
 # endif
 	test	%rax, %rax