summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2008-01-10 09:37:26 +0000
committertobias <tobias@openbsd.org>2008-01-10 09:37:26 +0000
commit9af0ab727cd7bee5c1b92bd0e65f4d76cd5c539f (patch)
tree3efd1f556ce9998b3bf9ab209ceb608c1e3bc63a /usr.bin/cvs/commit.c
parentAdded support for keyword $Log$. In order to support $Log$, new lines have (diff)
downloadwireguard-openbsd-9af0ab727cd7bee5c1b92bd0e65f4d76cd5c539f.tar.xz
wireguard-openbsd-9af0ab727cd7bee5c1b92bd0e65f4d76cd5c539f.zip
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.c5
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)