aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2020-07-17 18:17:41 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-07-17 18:27:24 +0100
commitd620bac888923524f8b8407dbf35f6d2b3b7ddb2 (patch)
tree61adbf3fcef193918c0645a348623865a2be7a36 /src
parent73336e08902a7e826f7d960453df037380266186 (diff)
downloadslirp-d620bac888923524f8b8407dbf35f6d2b3b7ddb2.zip
slirp-d620bac888923524f8b8407dbf35f6d2b3b7ddb2.tar.gz
slirp-d620bac888923524f8b8407dbf35f6d2b3b7ddb2.tar.bz2
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 <dgilbert@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/ip_input.c2
1 files changed, 1 insertions, 1 deletions
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;