]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Use memmove on overlapping regions, and operate with correct sizeof()
authorMartin Willi <martin@revosec.ch>
Thu, 30 Aug 2012 09:46:14 +0000 (11:46 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 3 Sep 2012 08:25:15 +0000 (10:25 +0200)
src/libtls/tls_eap.c

index 30533902a6a02c60be8e1b235076b08a849a85e0..928aadcb33ee81f43b83b774e908f404ded7d6c2 100644 (file)
@@ -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);