about summary refs log tree commit diff
path: root/sysdeps/x86_64/memchr.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-05-09 06:40:15 +0000
committerUlrich Drepper <drepper@redhat.com>2009-05-09 06:40:15 +0000
commit2221e33e5de0a17eef521b923229b2ede48abaad (patch)
treea239b0228691358c0595afebd0846d72dd73ad36 /sysdeps/x86_64/memchr.S
parentb5f7c4cae0c21e5a80fa2dfd4bacbf3cdeeca6a6 (diff)
downloadglibc-2221e33e5de0a17eef521b923229b2ede48abaad.tar.gz
glibc-2221e33e5de0a17eef521b923229b2ede48abaad.tar.xz
glibc-2221e33e5de0a17eef521b923229b2ede48abaad.zip
* sysdeps/x86_64/memchr.S: Handle invalid buffer pointers when
	count is zero.
Diffstat (limited to 'sysdeps/x86_64/memchr.S')
-rw-r--r--sysdeps/x86_64/memchr.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/x86_64/memchr.S b/sysdeps/x86_64/memchr.S
index 09ba6d4f8d..54b7af534c 100644
--- a/sysdeps/x86_64/memchr.S
+++ b/sysdeps/x86_64/memchr.S
@@ -26,7 +26,9 @@ ENTRY (memchr)
 	movq	%rdi, %rcx
 	punpcklbw %xmm1, %xmm1
 	andq	$~15, %rdi
+	testq	%rdx, %rdx
 	punpcklbw %xmm1, %xmm1
+	jz	3f
 	orl	$0xffffffff, %esi
 	movdqa	(%rdi), %xmm0
 	pshufd	$0, %xmm1, %xmm1