From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4439 invoked by alias); 29 Oct 2006 09:36:45 -0000 Received: (qmail 4412 invoked by uid 48); 29 Oct 2006 09:36:34 -0000 Date: Sun, 29 Oct 2006 09:36:00 -0000 From: "yuvalfl at gmail dot com" To: glibc-bugs@sources.redhat.com Message-ID: <20061029093634.3432.yuvalfl@gmail.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/3432] New: memmove() does not conform with the C99 standard. X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00144.txt.bz2 List-Id: By reviewing the glibc sources it turns out that memmove() only does word copy. Thus, the function will not work correctly when |dst-src|<|word|. The C99 standard (section 7.21.2.2 "The memmove function") mandates: --- #include void *memmove(void *s1, const void *s2, size_t n); The memmove function copies n characters from the object pointed to by s2 into the object pointed to by s1. Copying takes place as if the n characters from the object pointed to by s2 are first copied into a temporary array of n characters that does not overlap the objects pointed to by s1 and s2, and then the n characters from the temporary array are copied into the object pointed to by s1. --- -- Summary: memmove() does not conform with the C99 standard. Product: glibc Version: unspecified Status: NEW Severity: minor Priority: P2 Component: libc AssignedTo: drepper at redhat dot com ReportedBy: yuvalfl at gmail dot com CC: glibc-bugs at sources dot redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=3432 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.