summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranton <anton@openbsd.org>2017-10-16 13:10:50 +0000
committeranton <anton@openbsd.org>2017-10-16 13:10:50 +0000
commit79ef740f1b130dca3692681156813adf2b89819e (patch)
tree57e11bdf2bf33a58278bd43de9a0f55255bf1001
parentTypo in header dump, from sbz@FreeBSD (diff)
downloadwireguard-openbsd-79ef740f1b130dca3692681156813adf2b89819e.tar.xz
wireguard-openbsd-79ef740f1b130dca3692681156813adf2b89819e.zip
Favor memmove() over memcpy() since dst and src originates from the same
allocation and may therefore overlap. ok deraadt@
-rw-r--r--usr.bin/xargs/xargs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index d32364b16f1..0ab4d16a739 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xargs.c,v 1.32 2017/01/19 17:08:41 millert Exp $ */
+/* $OpenBSD: xargs.c,v 1.33 2017/10/16 13:10:50 anton Exp $ */
/* $FreeBSD: xargs.c,v 1.51 2003/05/03 19:09:11 obrien Exp $ */
/*-
@@ -405,7 +405,7 @@ addch: if (p < ebp) {
prerun(argc, av);
xp = bxp;
cnt = ebp - argp;
- memcpy(bbp, argp, (size_t)cnt);
+ memmove(bbp, argp, (size_t)cnt);
p = (argp = bbp) + cnt;
*p++ = ch;
break;