summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
authorjoris <joris@openbsd.org>2007-10-08 14:13:13 +0000
committerjoris <joris@openbsd.org>2007-10-08 14:13:13 +0000
commiteb6d38a60968e1648ce9054921f4d9827d141ccb (patch)
treebaab9d5229b8eb555267558e48311257cfba4cff /usr.bin/cvs/commit.c
parentbad place for a stray space; (diff)
downloadwireguard-openbsd-eb6d38a60968e1648ce9054921f4d9827d141ccb.tar.xz
wireguard-openbsd-eb6d38a60968e1648ce9054921f4d9827d141ccb.zip
do not try to reset the default branch if the RCS file
does not exist, fixes a segfault when commiting a new file. found by tobias@ who is going to make a nice little regression test for this.
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r--usr.bin/cvs/commit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index 1a90b308ea3..1a8bc470599 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.114 2007/10/03 13:12:06 joris Exp $ */
+/* $OpenBSD: commit.c,v 1.115 2007/10/08 14:13:13 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -289,7 +289,7 @@ cvs_commit_local(struct cvs_file *cf)
crev = NULL;
rrev = NULL;
- if (cf->file_rcs->rf_branch != NULL) {
+ if (cf->file_rcs != NULL && cf->file_rcs->rf_branch != NULL) {
rcsnum_free(cf->file_rcs->rf_branch);
cf->file_rcs->rf_branch = NULL;
}