mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 07:40:00 -04:00
towire_mx was using the wrong part of the target buffer.
This commit is contained in:
parent
bfb2a81b65
commit
bb690d7580
2 changed files with 4 additions and 4 deletions
|
|
@ -115,13 +115,13 @@ towire_mx(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
|||
|
||||
INSIST(rdata->type == 15);
|
||||
|
||||
isc_buffer_remaining(target, &tr);
|
||||
isc_buffer_available(target, &tr);
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
if (tr.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
memcpy(tr.base, region.base, 2);
|
||||
isc_region_consume(®ion, 2);
|
||||
isc_buffer_forward(target, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
|
|
|||
|
|
@ -115,13 +115,13 @@ towire_mx(dns_rdata_t *rdata, dns_compress_t *cctx, isc_buffer_t *target) {
|
|||
|
||||
INSIST(rdata->type == 15);
|
||||
|
||||
isc_buffer_remaining(target, &tr);
|
||||
isc_buffer_available(target, &tr);
|
||||
dns_rdata_toregion(rdata, ®ion);
|
||||
if (tr.length < 2)
|
||||
return (DNS_R_NOSPACE);
|
||||
memcpy(tr.base, region.base, 2);
|
||||
isc_region_consume(®ion, 2);
|
||||
isc_buffer_forward(target, 2);
|
||||
isc_buffer_add(target, 2);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
|
|
|
|||
Loading…
Reference in a new issue