From 2221e33e5de0a17eef521b923229b2ede48abaad Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 9 May 2009 06:40:15 +0000 Subject: * sysdeps/x86_64/memchr.S: Handle invalid buffer pointers when count is zero. --- sysdeps/x86_64/memchr.S | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sysdeps') 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 -- cgit 1.4.1