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:
@@ -152,7 +152,7 @@ add_rdata_to_list(dns_message_t *msg, dns_name_t *name, dns_rdata_t *rdata,
|
||||
dns_rdata_toregion(rdata, &r);
|
||||
RETERR(isc_buffer_allocate(msg->mctx, &tmprdatabuf, r.length));
|
||||
isc_buffer_availableregion(tmprdatabuf, &newr);
|
||||
memcpy(newr.base, r.base, r.length);
|
||||
memmove(newr.base, r.base, r.length);
|
||||
dns_rdata_fromregion(newrdata, rdata->rdclass, rdata->type, &newr);
|
||||
dns_message_takebuffer(msg, &tmprdatabuf);
|
||||
|
||||
@@ -252,12 +252,12 @@ compute_secret(isc_buffer_t *shared, isc_region_t *queryrandomness,
|
||||
if (r.length < sizeof(digests) || r.length < r2.length)
|
||||
return (ISC_R_NOSPACE);
|
||||
if (r2.length > sizeof(digests)) {
|
||||
memcpy(r.base, r2.base, r2.length);
|
||||
memmove(r.base, r2.base, r2.length);
|
||||
for (i = 0; i < sizeof(digests); i++)
|
||||
r.base[i] ^= digests[i];
|
||||
isc_buffer_add(secret, r2.length);
|
||||
} else {
|
||||
memcpy(r.base, digests, sizeof(digests));
|
||||
memmove(r.base, digests, sizeof(digests));
|
||||
for (i = 0; i < r2.length; i++)
|
||||
r.base[i] ^= r2.base[i];
|
||||
isc_buffer_add(secret, sizeof(digests));
|
||||
@@ -534,7 +534,7 @@ process_gsstkey(dns_name_t *name, dns_rdata_tkey_t *tkeyin,
|
||||
goto failure;
|
||||
}
|
||||
tkeyout->keylen = isc_buffer_usedlength(outtoken);
|
||||
memcpy(tkeyout->key, isc_buffer_base(outtoken),
|
||||
memmove(tkeyout->key, isc_buffer_base(outtoken),
|
||||
isc_buffer_usedlength(outtoken));
|
||||
isc_buffer_free(&outtoken);
|
||||
} else {
|
||||
@@ -544,7 +544,7 @@ process_gsstkey(dns_name_t *name, dns_rdata_tkey_t *tkeyin,
|
||||
goto failure;
|
||||
}
|
||||
tkeyout->keylen = tkeyin->keylen;
|
||||
memcpy(tkeyout->key, tkeyin->key, tkeyin->keylen);
|
||||
memmove(tkeyout->key, tkeyin->key, tkeyin->keylen);
|
||||
}
|
||||
|
||||
tkeyout->error = dns_rcode_noerror;
|
||||
|
Reference in New Issue
Block a user