From owner-svn-src-head@FreeBSD.ORG Thu Sep 30 14:28:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F41FB1065673; Thu, 30 Sep 2010 14:28:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45218FC08; Thu, 30 Sep 2010 14:28:48 +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 o8UESmId072159; Thu, 30 Sep 2010 14:28:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8UESmXK072157; Thu, 30 Sep 2010 14:28:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201009301428.o8UESmXK072157@svn.freebsd.org> From: John Baldwin Date: Thu, 30 Sep 2010 14:28:48 +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: r213300 - head/usr.bin/csup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2010 14:28:49 -0000 Author: jhb Date: Thu Sep 30 14:28:48 2010 New Revision: 213300 URL: http://svn.freebsd.org/changeset/base/213300 Log: If an RCS file is truncated, rcsfile_getdelta() will return NULL. Instead of faulting, check for NULL. However, returning an error would cause csup to just abort the entire update. Instead, break out of the loop and return ok. The attempts to update the file will trigger a MD5 failure which will cause csup to download the entire file as a fixup. Reviewed by: lulf MFC after: 1 week Modified: head/usr.bin/csup/rcsparse.c Modified: head/usr.bin/csup/rcsparse.c ============================================================================== --- head/usr.bin/csup/rcsparse.c Thu Sep 30 13:44:55 2010 (r213299) +++ head/usr.bin/csup/rcsparse.c Thu Sep 30 14:28:48 2010 (r213300) @@ -318,6 +318,14 @@ parse_deltatexts(struct rcsfile *rf, yys d = rcsfile_getdelta(rf, revnum); free(revnum); + /* + * XXX: The RCS file is corrupt, but lie and say it is ok. + * If it is actually broken, then the MD5 mismatch will + * trigger a fixup. + */ + if (d == NULL) + return (0); + /* log string */ asserttoken(sp, KEYWORD); asserttoken(sp, STRING);