From: Martin Willi Date: Thu, 30 Aug 2012 09:46:14 +0000 (+0200) Subject: Use memmove on overlapping regions, and operate with correct sizeof() X-Git-Tag: 5.0.1~111 X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=commitdiff_plain;h=acada66a351b4cc78dbd0d0210b74c902dbd24d7 Use memmove on overlapping regions, and operate with correct sizeof() --- diff --git a/src/libtls/tls_eap.c b/src/libtls/tls_eap.c index 3053390..928aadc 100644 --- a/src/libtls/tls_eap.c +++ b/src/libtls/tls_eap.c @@ -275,8 +275,8 @@ static status_t build_pkt(private_tls_eap_t *this, chunk_t *out) else { /* get rid of the reserved length field */ - memcpy(buf+sizeof(eap_packet_t), - buf+sizeof(eap_packet_t)+sizeof(u_int32_t), len); + memmove(buf + sizeof(eap_tls_packet_t), + buf + sizeof(eap_tls_packet_t) + sizeof(u_int32_t), len); } } len += sizeof(eap_tls_packet_t);