summaryrefslogtreecommitdiff
path: root/usr.bin/cvs
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@cvs.openbsd.org>2007-10-09 12:18:54 +0000
committerTobias Stoeckmann <tobias@cvs.openbsd.org>2007-10-09 12:18:54 +0000
commit6596966881eb7126860514a3ad7922c81e6995f6 (patch)
tree72b4955c5669768177da6ffff8df027dbe0abe8f /usr.bin/cvs
parent1a2f67af5793e0d148a90367e099c32088b412ca (diff)
Return NULL if a revision has been supplied that is higher than HEAD.
This one and previous OK niallo@, "makes sense to me" xsa@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r--usr.bin/cvs/rcs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index c4bb01d752d..d3d7048bba2 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.223 2007/10/09 12:16:29 tobias Exp $ */
+/* $OpenBSD: rcs.c,v 1.224 2007/10/09 12:18:53 tobias Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -2591,10 +2591,15 @@ rcs_translate_tag(const char *revstr, RCSFILE *rfp)
/*
* If it was not a branch, thats ok the symbolic
* name refered to a revision, so return the resolved
- * revision for the given name.
+ * revision for the given name if it is not newer than HEAD.
*/
- if (!RCSNUM_ISBRANCH(rev))
+ if (!RCSNUM_ISBRANCH(rev)) {
+ if (rcsnum_cmp(rev, rfp->rf_head, 0) < 0) {
+ rcsnum_free(rev);
+ return NULL;
+ }
return (rev);
+ }
brev = rcsnum_alloc();
rcsnum_cpy(rev, brev, rev->rn_len - 1);