summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcs.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2006-07-11 18:36:33 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2006-07-11 18:36:33 +0000
commit09bb305a3dffe5af98c96f852644454e64a9a066 (patch)
tree0364c7bc10124468bd99977d9df13bcffafa5d9f /usr.bin/rcs/rcs.c
parente11439b493f7f17321c06b3e6ea713591ee1ac49 (diff)
fix out of bound read in rcs_expand_keywords(); ok niallo
Diffstat (limited to 'usr.bin/rcs/rcs.c')
-rw-r--r--usr.bin/rcs/rcs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index 7efd5a757bf..b3d784ec579 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.22 2006/07/08 09:25:44 ray Exp $ */
+/* $OpenBSD: rcs.c,v 1.23 2006/07/11 18:36:32 markus Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -2756,7 +2756,7 @@ rcs_expand_keywords(char *rcsfile, struct rcs_delta *rdp, BUF *bp, int mode)
errx(1, "rcs_expand_keywords: string truncated");
sizdiff = strlen(expbuf) - (end - start);
- tbuflen = len - (end - start);
+ tbuflen = fin - end;
tbuf = xmalloc(tbuflen);
memcpy(tbuf, end, tbuflen);
/* only realloc if we have to */