From 9af0ab727cd7bee5c1b92bd0e65f4d76cd5c539f Mon Sep 17 00:00:00 2001 From: tobias Date: Thu, 10 Jan 2008 09:37:26 +0000 Subject: 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. --- usr.bin/cvs/commit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.bin/cvs/commit.c') 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 * Copyright (c) 2006 Xavier Santolaria @@ -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) -- cgit v1.2.3-59-g8ed1b