summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniallo <niallo@openbsd.org>2006-06-04 02:56:53 +0000
committerniallo <niallo@openbsd.org>2006-06-04 02:56:53 +0000
commit331c47ae45fe24f169ca052ea7600e711e2ed8fc (patch)
treec07c1dea7bde8872cdd88291aca0272335fb1f55
parent- don't forget to free data in rcs_expand_keywords() (diff)
downloadwireguard-openbsd-331c47ae45fe24f169ca052ea7600e711e2ed8fc.tar.xz
wireguard-openbsd-331c47ae45fe24f169ca052ea7600e711e2ed8fc.zip
- ensure fin pointer is not invalidated after realloc
-rw-r--r--usr.bin/rcs/rcs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c
index 4a2a81c4974..aa99389817b 100644
--- a/usr.bin/rcs/rcs.c
+++ b/usr.bin/rcs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.14 2006/06/04 02:54:59 niallo Exp $ */
+/* $OpenBSD: rcs.c,v 1.15 2006/06/04 02:56:53 niallo Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -2768,6 +2768,7 @@ rcs_expand_keywords(char *rcsfile, struct rcs_delta *rdp, BUF *bp, int mode)
* after realloc()
*/
start = data + start_offset;
+ fin = data + len;
}
memcpy(start, expbuf, strlen(expbuf));
start += strlen(expbuf);