From owner-svn-src-all@FreeBSD.ORG Thu Jan 21 03:49:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 622C8106566C; Thu, 21 Jan 2010 03:49:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 515AA8FC14; Thu, 21 Jan 2010 03:49:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0L3nI1p008349; Thu, 21 Jan 2010 03:49:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0L3nIBc008347; Thu, 21 Jan 2010 03:49:18 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201001210349.o0L3nIBc008347@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 21 Jan 2010 03:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202734 - head/usr.sbin/extattr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2010 03:49:18 -0000 Author: nwhitehorn Date: Thu Jan 21 03:49:18 2010 New Revision: 202734 URL: http://svn.freebsd.org/changeset/base/202734 Log: Fix a bug when printing attributes from multiple files: buflen could be longer than the length of the current attribute if the buffer were reused and previously longer, so bits of the previous, longer attribute would be written. Fix this by using the actual attribute length. Modified: head/usr.sbin/extattr/rmextattr.c Modified: head/usr.sbin/extattr/rmextattr.c ============================================================================== --- head/usr.sbin/extattr/rmextattr.c Thu Jan 21 03:06:52 2010 (r202733) +++ head/usr.sbin/extattr/rmextattr.c Thu Jan 21 03:49:18 2010 (r202734) @@ -269,7 +269,7 @@ main(int argc, char *argv[]) printf("\n"); continue; } else { - fwrite(buf, buflen, 1, stdout); + fwrite(buf, error, 1, stdout); printf("\n"); continue; }