diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-01-10 09:37:27 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-01-10 09:37:27 +0000 |
commit | ac6fcbbef14bd3e4ade42734955fce5a4605ecd7 (patch) | |
tree | 64fc032014b8dfeed60e3de7f7066a11daab350b /usr.bin/cvs/commit.c | |
parent | a108fb9651b376c2877c0f89839515474f0e08bc (diff) |
RCS files without head keyword mustn't segfault our implementation. Only
command that supports such files is "cvs status", therefore properly handle
them in all other commands, too.
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r-- | usr.bin/cvs/commit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 1a8bc470599..b388e5bdbb9 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.115 2007/10/08 14:13:13 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.116 2008/01/10 09:37:26 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -299,6 +299,9 @@ cvs_commit_local(struct cvs_file *cf) && cf->file_rcs != NULL && cf->file_rcs->rf_dead == 1)) { rrev = rcs_head_get(cf->file_rcs); crev = rcs_head_get(cf->file_rcs); + if (crev == NULL || rrev == NULL) + fatal("RCS head empty or missing in %s\n", + cf->file_rcs->rf_path); tag = cvs_directory_tag; if (cf->file_ent != NULL && cf->file_ent->ce_tag != NULL) |