summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorray <ray@openbsd.org>2006-07-28 05:41:45 +0000
committerray <ray@openbsd.org>2006-07-28 05:41:45 +0000
commitd382b4ff229b63db9d111c3e224afd9a6d383beb (patch)
tree3ce8bb1ee4fae8bdd27eeeb161d3cb781350c6b9
parentremove weird floppyboot garbage; ok miod (diff)
downloadwireguard-openbsd-d382b4ff229b63db9d111c3e224afd9a6d383beb.tar.xz
wireguard-openbsd-d382b4ff229b63db9d111c3e224afd9a6d383beb.zip
Recalculate buffer length after each expansion.
OK niallo@
-rw-r--r--usr.bin/rcs/rcs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index 98e8adde2bf..251eb83df0b 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.28 2006/07/27 04:23:37 ray Exp $ */
+/* $OpenBSD: rcs.c,v 1.29 2006/07/28 05:41:45 ray Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -2755,6 +2755,8 @@ rcs_expand_keywords(char *rcsfile, struct rcs_delta *rdp, BUF *bp, int mode)
((unsigned char *)rcs_buf_get(newbuf) + rcs_buf_len(newbuf)) - end);
/* Point fin to end of data. */
fin = rcs_buf_get(tmpbuf) + rcs_buf_len(tmpbuf) - 1;
+ /* Recalculate new length. */
+ len = rcs_buf_len(tmpbuf);
/* tmpbuf is now ready, free old newbuf if allocated here. */
if (newbuf != bp)