diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-08-29 16:42:31 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2024-08-29 16:42:31 +0000 |
commit | ed55d60307846a56ce1e0866aef44c1e575d7a7e (patch) | |
tree | 7c102c62647567315f1132171202731c26127c1f /sys | |
parent | 437e564747d4773687515e9c80307b5a289a09ee (diff) |
In m_pulldown() replace memmove() with memcpy().
The memmove() in m_pulldown() copied memory between different mbufs.
So data cannot overlap and memcpy() is enough.
OK claudio@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_mbuf2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index 6a4bdca56ab..a51e3f02911 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf2.c,v 1.46 2024/08/29 10:44:40 bluhm Exp $ */ +/* $OpenBSD: uipc_mbuf2.c,v 1.47 2024/08/29 16:42:30 bluhm Exp $ */ /* $KAME: uipc_mbuf2.c,v 1.29 2001/02/14 13:42:10 itojun Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */ @@ -171,7 +171,7 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp) n->m_next->m_data -= hlen; n->m_next->m_len += hlen; counters_inc(mbstat, MBSTAT_PULLDOWN_COPY); - memmove(mtod(n->m_next, caddr_t), mtod(n, caddr_t) + off, hlen); + memcpy(mtod(n->m_next, caddr_t), mtod(n, caddr_t) + off, hlen); n->m_len -= hlen; n = n->m_next; off = 0; @@ -201,7 +201,7 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp) } /* get hlen from <n, off> into <o, 0> */ o->m_len = hlen; - memmove(mtod(o, caddr_t), mtod(n, caddr_t) + off, hlen); + memcpy(mtod(o, caddr_t), mtod(n, caddr_t) + off, hlen); n->m_len -= hlen; /* get tlen from <n->m_next, 0> into <o, hlen> */ m_copydata(n->m_next, 0, tlen, mtod(o, caddr_t) + o->m_len); |