mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
[master] replace memcpy() with memmove().
3698. [cleanup] Replaced all uses of memcpy() with memmove(). [RT #35120]
This commit is contained in:
@@ -295,7 +295,7 @@ dns_dnssec_sign(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
* Create an envelope for each rdata: <name|type|class|ttl>.
|
||||
*/
|
||||
isc_buffer_init(&envbuf, data, sizeof(data));
|
||||
memcpy(data, r.base, r.length);
|
||||
memmove(data, r.base, r.length);
|
||||
isc_buffer_add(&envbuf, r.length);
|
||||
isc_buffer_putuint16(&envbuf, set->type);
|
||||
isc_buffer_putuint16(&envbuf, set->rdclass);
|
||||
@@ -501,10 +501,10 @@ dns_dnssec_verify3(dns_name_t *name, dns_rdataset_t *set, dst_key_t *key,
|
||||
if (labels - sig.labels > 0) {
|
||||
isc_buffer_putuint8(&envbuf, 1);
|
||||
isc_buffer_putuint8(&envbuf, '*');
|
||||
memcpy(data + 2, r.base, r.length);
|
||||
memmove(data + 2, r.base, r.length);
|
||||
}
|
||||
else
|
||||
memcpy(data, r.base, r.length);
|
||||
memmove(data, r.base, r.length);
|
||||
isc_buffer_add(&envbuf, r.length);
|
||||
isc_buffer_putuint16(&envbuf, set->type);
|
||||
isc_buffer_putuint16(&envbuf, set->rdclass);
|
||||
@@ -1040,14 +1040,14 @@ dns_dnssec_verifymessage(isc_buffer_t *source, dns_message_t *msg,
|
||||
/*
|
||||
* Extract the header.
|
||||
*/
|
||||
memcpy(header, source_r.base, DNS_MESSAGE_HEADERLEN);
|
||||
memmove(header, source_r.base, DNS_MESSAGE_HEADERLEN);
|
||||
|
||||
/*
|
||||
* Decrement the additional field counter.
|
||||
*/
|
||||
memcpy(&addcount, &header[DNS_MESSAGE_HEADERLEN - 2], 2);
|
||||
memmove(&addcount, &header[DNS_MESSAGE_HEADERLEN - 2], 2);
|
||||
addcount = htons((isc_uint16_t)(ntohs(addcount) - 1));
|
||||
memcpy(&header[DNS_MESSAGE_HEADERLEN - 2], &addcount, 2);
|
||||
memmove(&header[DNS_MESSAGE_HEADERLEN - 2], &addcount, 2);
|
||||
|
||||
/*
|
||||
* Digest the modified header.
|
||||
|
Reference in New Issue
Block a user