diff options
author | anton <anton@cvs.openbsd.org> | 2017-10-16 13:10:51 +0000 |
---|---|---|
committer | anton <anton@cvs.openbsd.org> | 2017-10-16 13:10:51 +0000 |
commit | 541407072cd7d96a45e9c240147c96ec12fa2637 (patch) | |
tree | e333da85dff54f014ed2a460bd5eb71ea08db114 /usr.bin/xargs | |
parent | d77d25197a35376db3e76b0b40024cf99a3ca6b9 (diff) |
Favor memmove() over memcpy() since dst and src originates from the same
allocation and may therefore overlap.
ok deraadt@
Diffstat (limited to 'usr.bin/xargs')
-rw-r--r-- | usr.bin/xargs/xargs.c | 4 |
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; |