summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2008-02-13 17:05:14 +0000
committerJoris Vink <joris@cvs.openbsd.org>2008-02-13 17:05:14 +0000
commit103b03191cf7af64eff2b4fc65f6b7c6e446d7c1 (patch)
tree1cf63a5213d8f0f29eb0c28ddb44ce76c0529e8a /usr.bin
parent1fade25aa77465c09e8c40896b78c15a89b5bd84 (diff)
fix a crash that could happen when running status on unknown files.
from Tero Koskinen.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/status.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c
index c31ccc4a683..92f82fdba6e 100644
--- a/usr.bin/cvs/status.c
+++ b/usr.bin/cvs/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.82 2008/02/10 14:08:52 xsa Exp $ */
+/* $OpenBSD: status.c,v 1.83 2008/02/13 17:05:13 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2005-2008 Xavier Santolaria <xsa@openbsd.org>
@@ -133,9 +133,13 @@ cvs_status_local(struct cvs_file *cf)
return;
}
- head = rcs_head_get(cf->file_rcs);
- if (head == NULL && cf->file_status != FILE_REMOVE_ENTRY)
- return;
+ if (cf->file_rcs != NULL) {
+ head = rcs_head_get(cf->file_rcs);
+ if (head == NULL && cf->file_status != FILE_REMOVE_ENTRY)
+ return;
+ } else {
+ head = NULL;
+ }
cvs_printf("%s\n", CVS_STATUS_SEP);
@@ -145,7 +149,6 @@ cvs_status_local(struct cvs_file *cf)
status = "File had conflicts on merge";
if (cf->file_status == FILE_LOST ||
- cf->file_status == FILE_UNKNOWN ||
cf->file_status == FILE_REMOVE_ENTRY ||
(cf->file_rcs != NULL && cf->in_attic == 1 && cf->fd == -1)) {
(void)xsnprintf(buf, sizeof(buf), "no file %s\t",