On 01/04/2013 05:47 PM, Bruce Korb wrote: > You may have been thinking you were using "memcpy", but you were > using "bcopy" instead. Please apply the patch to md5.c. Thanks! >
Rather than fixing the call site of memcpy, we should instead fix the real bug, the fact that you are even doing *ifndef HAVE_MEMCPY and defining memcpy to bcopy() in the first place. For some reason, your ./configure run is not properly setting HAVE_MEMCPY in your config.h file. Not that it needs to be set: these days, we can assume C89, and therefore can assume memcpy; code that uses bcopy() is obsolete, and actually less portable. The version of md5.c in gnulib does not suffer from the same bug as the version in sharutils.git. Therefore, I don't see why we need to patch gnulib at this time. Are you sure you updated sharutils properly? For starters: $ diff -ub ../sharutils/lib/md5.c lib/md5.c |head -55 |xclip --- ../sharutils/lib/md5.c 2013-01-04 19:12:38.105067385 -0700 +++ lib/md5.c 2012-12-31 17:50:53.232969921 -0700 @@ -1,12 +1,12 @@ -/* md5.c - Functions to compute MD5 message digest of files or memory blocks +/* Functions to compute MD5 message digest of files or memory blocks. according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995, 1996, 2001, 2007 Free Software Foundation, Inc. - NOTE: The canonical source of this file is maintained with the GNU C - Library. Bugs can be reported to bug-gl...@prep.ai.mit.edu. + Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2013 Free Software + Foundation, Inc. + This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 3, or (at your option) any + Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,56 +15,51 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + along with this program; if not, see <http://www.gnu.org/licenses/>. */ /* Written by Ulrich Drepper <drep...@gnu.ai.mit.edu>, 1995. */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif +#include <config.h> + +#include "md5.h" +#include <stdalign.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> #include <sys/types.h> -#if STDC_HEADERS || defined _LIBC -# include <stdlib.h> -# include <string.h> -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# endif +#if USE_UNLOCKED_IO +# include "unlocked-io.h" #endif -#include "md5.h" -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature