]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix dns_client_addtrustedkey(dns_rdatatype_dnskey)
authorTony Finch <dot@dotat.at>
Fri, 28 Feb 2020 20:08:04 +0000 (20:08 +0000)
committerEvan Hunt <each@isc.org>
Wed, 4 Mar 2020 16:59:29 +0000 (08:59 -0800)
Use a buffer that is big enough for DNSKEY records as well as DS
records.

lib/dns/client.c

index 0d8e951fa0de7218b7188364267d5b6878e7e343..6a003e8d79ee7cb7cdb046eff6c72107db18d414 100644 (file)
@@ -1519,7 +1519,7 @@ dns_client_addtrustedkey(dns_client_t *client, dns_rdataclass_t rdclass,
        dns_view_t *view = NULL;
        dns_keytable_t *secroots = NULL;
        dns_name_t *name = NULL;
-       char dsbuf[DNS_DS_BUFFERSIZE];
+       char rdatabuf[DST_KEY_MAXSIZE];
        unsigned char digest[ISC_MAX_MD_SIZE];
        dns_rdata_ds_t ds;
        dns_decompress_t dctx;
@@ -1543,7 +1543,7 @@ dns_client_addtrustedkey(dns_client_t *client, dns_rdataclass_t rdclass,
                goto cleanup;
        }
 
-       isc_buffer_init(&b, dsbuf, sizeof(dsbuf));
+       isc_buffer_init(&b, rdatabuf, sizeof(rdatabuf));
        dns_decompress_init(&dctx, -1, DNS_DECOMPRESS_NONE);
        dns_rdata_init(&rdata);
        isc_buffer_setactive(databuf, isc_buffer_usedlength(databuf));