summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormestre <mestre@openbsd.org>2016-03-19 00:21:28 +0000
committermestre <mestre@openbsd.org>2016-03-19 00:21:28 +0000
commit77239675b4b30cd3f7fb32307ed0eebb3cd58c33 (patch)
tree747690a3b4dacbe509397c12d0f5afd005518c56
parentif -a is specified, allow "dns" in pledge requests. (diff)
downloadwireguard-openbsd-77239675b4b30cd3f7fb32307ed0eebb3cd58c33.tar.xz
wireguard-openbsd-77239675b4b30cd3f7fb32307ed0eebb3cd58c33.zip
By issuing :e +something in vi(1) this uncovers a backwards memcpy with the
code because the 2 buffers overlap and in order to solve it then replace memcpy(3) call by memmove(3) Issue noticed by Michael Price <michael at ectospheno dot com> who also tested this diff OK deraadt@
-rw-r--r--usr.bin/vi/ex/ex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/vi/ex/ex.c b/usr.bin/vi/ex/ex.c
index 79cd6ba63af..912768e88d2 100644
--- a/usr.bin/vi/ex/ex.c
+++ b/usr.bin/vi/ex/ex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex.c,v 1.20 2016/01/06 22:28:52 millert Exp $ */
+/* $OpenBSD: ex.c,v 1.21 2016/03/19 00:21:28 mestre Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -1488,7 +1488,7 @@ addr_verify:
ecp->save_cmd -= arg1_len;
ecp->save_cmdlen += arg1_len;
- memcpy(ecp->save_cmd, arg1, arg1_len);
+ memmove(ecp->save_cmd, arg1, arg1_len);
/*
* Any commands executed from a +cmd are executed starting at