summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-04-18 22:28:42 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-04-18 22:28:42 +0000
commit770f7d375856ab88cdea4338eeab506a9da62849 (patch)
treee1790cf08ae3b8ede73f30cbb300e7a63809d8c4 /usr.bin/cvs
parent7f294a59cb2bc7a1f685048adf574b34d1aa97c9 (diff)
only copy ce_tag is it is not NULL, fixes a segfault on
startup for the update command.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index f021976ebd0..ab497f340de 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.64 2005/04/18 21:24:57 joris Exp $ */
+/* $OpenBSD: file.c,v 1.65 2005/04/18 22:28:41 joris Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -926,9 +926,11 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, struct cvs_ent *ent)
if (ent != NULL) {
/* steal the RCSNUM */
cfp->cf_lrev = ent->ce_rev;
- if ((cfp->cf_tag = cvs_strdup(ent->ce_tag)) == NULL) {
- cvs_file_free(cfp);
- return (NULL);
+ if (ent->ce_tag != NULL) {
+ if ((cfp->cf_tag = cvs_strdup(ent->ce_tag)) == NULL) {
+ cvs_file_free(cfp);
+ return (NULL);
+ }
}
ent->ce_rev = NULL;
}