From d620bac888923524f8b8407dbf35f6d2b3b7ddb2 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Fri, 17 Jul 2020 18:17:41 +0100 Subject: ip_stripoptions use memmove ip_stripoptions is moving data long in the same buffer; that's undefined with memcpy, use memmove. Buglink: https://bugs.launchpad.net/qemu/+bug/1878043 Signed-off-by: Dr. David Alan Gilbert --- src/ip_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ip_input.c b/src/ip_input.c index 89a01d4..7f017a2 100644 --- a/src/ip_input.c +++ b/src/ip_input.c @@ -454,7 +454,7 @@ void ip_stripoptions(register struct mbuf *m, struct mbuf *mopt) olen = (ip->ip_hl << 2) - sizeof(struct ip); opts = (char *)(ip + 1); i = m->m_len - (sizeof(struct ip) + olen); - memcpy(opts, opts + olen, (unsigned)i); + memmove(opts, opts + olen, (unsigned)i); m->m_len -= olen; ip->ip_hl = sizeof(struct ip) >> 2; -- cgit v1.1