Date: Thu, 30 Sep 2010 14:28:48 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r213300 - head/usr.bin/csup Message-ID: <201009301428.o8UESmXK072157@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009301428.o8UESmXK072157>