diff options
author | bluhm <bluhm@openbsd.org> | 2017-03-24 16:24:36 +0000 |
---|---|---|
committer | bluhm <bluhm@openbsd.org> | 2017-03-24 16:24:36 +0000 |
commit | 7c4cfb826c1f1ecde1a305cadd6f6734fa190d11 (patch) | |
tree | 0936a206090feffeb813c12834b96492c1d20a76 /usr.sbin/syslogd | |
parent | add a helper function to print all pools #ifdef MALLOC_STATS (diff) | |
download | wireguard-openbsd-7c4cfb826c1f1ecde1a305cadd6f6734fa190d11.tar.xz wireguard-openbsd-7c4cfb826c1f1ecde1a305cadd6f6734fa190d11.zip |
Replace bcopy(3) with memmove(3) in function ttymsg(). Values of
iov and localiov may overlap. No more bcopy(3) in syslogd(8).
from Michael W. Bombardieri
Diffstat (limited to 'usr.sbin/syslogd')
-rw-r--r-- | usr.sbin/syslogd/ttymsg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/syslogd/ttymsg.c b/usr.sbin/syslogd/ttymsg.c index 903bfc746fd..4d35e65ef1f 100644 --- a/usr.sbin/syslogd/ttymsg.c +++ b/usr.sbin/syslogd/ttymsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttymsg.c,v 1.12 2017/03/16 12:14:37 bluhm Exp $ */ +/* $OpenBSD: ttymsg.c,v 1.13 2017/03/24 16:24:36 bluhm Exp $ */ /* $NetBSD: ttymsg.c,v 1.3 1994/11/17 07:17:55 jtc Exp $ */ /* @@ -115,7 +115,7 @@ ttymsg(struct iovec *iov, int iovcnt, char *utline) break; left -= wret; if (iov != localiov) { - bcopy(iov, localiov, + memmove(localiov, iov, iovcnt * sizeof(struct iovec)); iov = localiov; } @@ -141,7 +141,7 @@ ttymsg(struct iovec *iov, int iovcnt, char *utline) } logdebug("ttymsg delayed write\n"); if (iov != localiov) { - bcopy(iov, localiov, + memmove(localiov, iov, iovcnt * sizeof(struct iovec)); iov = localiov; } |