From b77829a82ea87b9804631ca7a4ff3c3e6d3ac074 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Mon, 9 Jun 2008 16:34:23 +0000 Subject: 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. --- usr.bin/cvs/annotate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.bin/cvs/annotate.c') 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 * Copyright (c) 2006 Xavier Santolaria @@ -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) { -- cgit v1.2.3