]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix possibly unaligned memory access.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 16 Aug 2023 12:57:38 +0000 (14:57 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 16 Aug 2023 12:57:38 +0000 (14:57 +0200)
testcode/testpkts.c

index 22d846d2bac2e44c88c533ebf1e95eff5cb85203..aa852f01ee47df1c1aa71bda8f6faedf1a4697d6 100644 (file)
@@ -928,7 +928,7 @@ pkt_snip_edns_option(uint8_t* pkt, size_t len, sldns_edns_option code,
                optlen = sldns_read_uint16(rdata+2);
                if(sldns_read_uint16(rdata) == code) {
                        /* save data to buf for caller inspection */
-                       memcpy(buf, rdata+4, optlen);
+                       memmove(buf, rdata+4, optlen);
                        /* snip option from packet; assumes len is correct */
                        memmove(rdata, rdata+4+optlen,
                                (pkt+len)-(rdata+4+optlen));