diff options
author | jhb <jhb@FreeBSD.org> | 2010-09-30 14:28:48 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-09-30 14:28:48 +0000 |
commit | cc806ac0f293790421a14e8a683e4311220ce5a7 (patch) | |
tree | 8424cb71328d819abe9dff490c5772fa08ee96d6 | |
parent | a02f9edef384f097b928bdd31973bd76829e48bf (diff) | |
download | FreeBSD-src-cc806ac0f293790421a14e8a683e4311220ce5a7.zip FreeBSD-src-cc806ac0f293790421a14e8a683e4311220ce5a7.tar.gz |
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
-rw-r--r-- | usr.bin/csup/rcsparse.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/csup/rcsparse.c b/usr.bin/csup/rcsparse.c index 5ea690c..248d0ab 100644 --- a/usr.bin/csup/rcsparse.c +++ b/usr.bin/csup/rcsparse.c @@ -318,6 +318,14 @@ parse_deltatexts(struct rcsfile *rf, yyscan_t *sp, int token) 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); |