summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2008-06-09 16:34:23 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2008-06-09 16:34:23 +0000
commitb77829a82ea87b9804631ca7a4ff3c3e6d3ac074 (patch)
tree2dd665a346b66fde1588df820194a5f63dfc356b /usr.bin/cvs
parent55f33722e8e3b9a109bb951fa8d2c71b71ea655f (diff)
Check if RCS file exists before trying to retrieve revisions for annotate,
fixes segmentation fault on added but not yet committed files for example. Based on diff by Igor Zinovik.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/annotate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c
index 8c21e7c73f3..64ba622da69 100644
--- a/usr.bin/cvs/annotate.c
+++ b/usr.bin/cvs/annotate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: annotate.c,v 1.57 2008/03/02 19:14:10 tobias Exp $ */
+/* $OpenBSD: annotate.c,v 1.58 2008/06/09 16:34:22 tobias Exp $ */
/*
* Copyright (c) 2007 Tobias Stoeckmann <tobias@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -163,8 +163,7 @@ cvs_annotate_local(struct cvs_file *cf)
cvs_file_classify(cf, cvs_directory_tag);
- if (cf->file_status == FILE_UNKNOWN || cf->file_status == FILE_UNLINK ||
- cf->file_type != CVS_FILE)
+ if (cf->file_rcs == NULL)
return;
if (cvs_specified_tag != NULL) {