Commit b589e906 authored by Mark Andrews's avatar Mark Andrews
Browse files

Remove the rdata->length == 0 checks, UPDATE pseudo rdata are now tagged.

Add sanity checks to rdata types where the length cannot legally be zero.
parent c03bb27f
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: rdata.c,v 1.113 2000/10/25 04:26:44 marka Exp $ */ /* $Id: rdata.c,v 1.114 2000/10/25 05:43:24 marka Exp $ */
#include <config.h> #include <config.h>
#include <ctype.h> #include <ctype.h>
...@@ -515,9 +515,6 @@ dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx, ...@@ -515,9 +515,6 @@ dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx,
INSIST(rdata->length == 0); INSIST(rdata->length == 0);
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
} }
#if 0
INSIST(rdata->type == dns_rdatatype_opt || rdata->length != 0); /* XXXMPA remove */
#endif
st = *target; st = *target;
...@@ -761,8 +758,10 @@ rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx, ...@@ -761,8 +758,10 @@ rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
/* /*
* Some DynDNS meta-RRs have empty rdata. * Some DynDNS meta-RRs have empty rdata.
*/ */
if (rdata->length == 0) if ((rdata->flags & DNS_RDATA_UPDATE) != 0) {
INSIST(rdata->length == 0);
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
}
TOTEXTSWITCH TOTEXTSWITCH
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: tsig_250.c,v 1.43 2000/08/01 01:25:04 tale Exp $ */ /* $Id: tsig_250.c,v 1.44 2000/10/25 05:43:26 marka Exp $ */
/* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */ /* Reviewed: Thu Mar 16 13:39:43 PST 2000 by gson */
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
(DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_NOTQUESTION) (DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_NOTQUESTION)
static inline isc_result_t static inline isc_result_t
fromtext_any_tsig(ARGS_FROMTEXT) { fromtext_any_tsig(ARGS_FROMTEXT) {
isc_token_t token; isc_token_t token;
dns_name_t name; dns_name_t name;
isc_uint64_t sigtime; isc_uint64_t sigtime;
...@@ -132,6 +132,7 @@ totext_any_tsig(ARGS_TOTEXT) { ...@@ -132,6 +132,7 @@ totext_any_tsig(ARGS_TOTEXT) {
REQUIRE(rdata->type == 250); REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255); REQUIRE(rdata->rdclass == 255);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &sr); dns_rdata_toregion(rdata, &sr);
/* /*
...@@ -297,6 +298,7 @@ towire_any_tsig(ARGS_TOWIRE) { ...@@ -297,6 +298,7 @@ towire_any_tsig(ARGS_TOWIRE) {
REQUIRE(rdata->type == 250); REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255); REQUIRE(rdata->rdclass == 255);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_rdata_toregion(rdata, &sr); dns_rdata_toregion(rdata, &sr);
...@@ -319,6 +321,8 @@ compare_any_tsig(ARGS_COMPARE) { ...@@ -319,6 +321,8 @@ compare_any_tsig(ARGS_COMPARE) {
REQUIRE(rdata1->rdclass == rdata2->rdclass); REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 250); REQUIRE(rdata1->type == 250);
REQUIRE(rdata1->rdclass == 255); REQUIRE(rdata1->rdclass == 255);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1); dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2); dns_rdata_toregion(rdata2, &r2);
...@@ -410,6 +414,7 @@ tostruct_any_tsig(ARGS_TOSTRUCT) { ...@@ -410,6 +414,7 @@ tostruct_any_tsig(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 250); REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255); REQUIRE(rdata->rdclass == 255);
REQUIRE(rdata->length != 0);
tsig = (dns_rdata_any_tsig_t *) target; tsig = (dns_rdata_any_tsig_t *) target;
tsig->common.rdclass = rdata->rdclass; tsig->common.rdclass = rdata->rdclass;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: afsdb_18.c,v 1.31 2000/08/01 01:25:06 tale Exp $ */ /* $Id: afsdb_18.c,v 1.32 2000/10/25 05:43:27 marka Exp $ */
/* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */ /* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */
...@@ -64,6 +64,7 @@ totext_afsdb(ARGS_TOTEXT) { ...@@ -64,6 +64,7 @@ totext_afsdb(ARGS_TOTEXT) {
unsigned int num; unsigned int num;
REQUIRE(rdata->type == 18); REQUIRE(rdata->type == 18);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL); dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL); dns_name_init(&prefix, NULL);
...@@ -111,6 +112,7 @@ towire_afsdb(ARGS_TOWIRE) { ...@@ -111,6 +112,7 @@ towire_afsdb(ARGS_TOWIRE) {
dns_name_t name; dns_name_t name;
REQUIRE(rdata->type == 18); REQUIRE(rdata->type == 18);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
isc_buffer_availableregion(target, &tr); isc_buffer_availableregion(target, &tr);
...@@ -138,6 +140,8 @@ compare_afsdb(ARGS_COMPARE) { ...@@ -138,6 +140,8 @@ compare_afsdb(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type); REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass); REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 18); REQUIRE(rdata1->type == 18);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
result = memcmp(rdata1->data, rdata2->data, 2); result = memcmp(rdata1->data, rdata2->data, 2);
if (result != 0) if (result != 0)
...@@ -181,6 +185,7 @@ tostruct_afsdb(ARGS_TOSTRUCT) { ...@@ -181,6 +185,7 @@ tostruct_afsdb(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 18); REQUIRE(rdata->type == 18);
REQUIRE(target != NULL); REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
afsdb->common.rdclass = rdata->rdclass; afsdb->common.rdclass = rdata->rdclass;
afsdb->common.rdtype = rdata->type; afsdb->common.rdtype = rdata->type;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: cert_37.c,v 1.32 2000/08/01 01:25:08 tale Exp $ */ /* $Id: cert_37.c,v 1.33 2000/10/25 05:43:28 marka Exp $ */
/* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */ /* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */
...@@ -70,6 +70,7 @@ totext_cert(ARGS_TOTEXT) { ...@@ -70,6 +70,7 @@ totext_cert(ARGS_TOTEXT) {
unsigned int n; unsigned int n;
REQUIRE(rdata->type == 37); REQUIRE(rdata->type == 37);
REQUIRE(rdata->length != 0);
UNUSED(tctx); UNUSED(tctx);
...@@ -133,6 +134,7 @@ towire_cert(ARGS_TOWIRE) { ...@@ -133,6 +134,7 @@ towire_cert(ARGS_TOWIRE) {
isc_region_t sr; isc_region_t sr;
REQUIRE(rdata->type == 37); REQUIRE(rdata->type == 37);
REQUIRE(rdata->length != 0);
UNUSED(cctx); UNUSED(cctx);
...@@ -148,6 +150,8 @@ compare_cert(ARGS_COMPARE) { ...@@ -148,6 +150,8 @@ compare_cert(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type); REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass); REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 37); REQUIRE(rdata1->type == 37);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1); dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2); dns_rdata_toregion(rdata2, &r2);
...@@ -177,6 +181,7 @@ tostruct_cert(ARGS_TOSTRUCT) { ...@@ -177,6 +181,7 @@ tostruct_cert(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 37); REQUIRE(rdata->type == 37);
REQUIRE(target != NULL); REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
cert->common.rdclass = rdata->rdclass; cert->common.rdclass = rdata->rdclass;
cert->common.rdtype = rdata->type; cert->common.rdtype = rdata->type;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: cname_5.c,v 1.35 2000/08/01 01:25:10 tale Exp $ */ /* $Id: cname_5.c,v 1.36 2000/10/25 05:43:29 marka Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
...@@ -51,6 +51,7 @@ totext_cname(ARGS_TOTEXT) { ...@@ -51,6 +51,7 @@ totext_cname(ARGS_TOTEXT) {
isc_boolean_t sub; isc_boolean_t sub;
REQUIRE(rdata->type == 5); REQUIRE(rdata->type == 5);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL); dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL); dns_name_init(&prefix, NULL);
...@@ -83,6 +84,7 @@ towire_cname(ARGS_TOWIRE) { ...@@ -83,6 +84,7 @@ towire_cname(ARGS_TOWIRE) {
isc_region_t region; isc_region_t region;
REQUIRE(rdata->type == 5); REQUIRE(rdata->type == 5);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14); dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
...@@ -103,6 +105,8 @@ compare_cname(ARGS_COMPARE) { ...@@ -103,6 +105,8 @@ compare_cname(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type); REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass); REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 5); REQUIRE(rdata1->type == 5);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL); dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL); dns_name_init(&name2, NULL);
...@@ -138,6 +142,7 @@ tostruct_cname(ARGS_TOSTRUCT) { ...@@ -138,6 +142,7 @@ tostruct_cname(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 5); REQUIRE(rdata->type == 5);
REQUIRE(target != NULL); REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
cname->common.rdclass = rdata->rdclass; cname->common.rdclass = rdata->rdclass;
cname->common.rdtype = rdata->type; cname->common.rdtype = rdata->type;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: dname_39.c,v 1.25 2000/08/01 01:25:13 tale Exp $ */ /* $Id: dname_39.c,v 1.26 2000/10/25 05:43:30 marka Exp $ */
/* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */ /* Reviewed: Wed Mar 15 16:52:38 PST 2000 by explorer */
...@@ -52,6 +52,7 @@ totext_dname(ARGS_TOTEXT) { ...@@ -52,6 +52,7 @@ totext_dname(ARGS_TOTEXT) {
isc_boolean_t sub; isc_boolean_t sub;
REQUIRE(rdata->type == 39); REQUIRE(rdata->type == 39);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL); dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL); dns_name_init(&prefix, NULL);
...@@ -84,6 +85,7 @@ towire_dname(ARGS_TOWIRE) { ...@@ -84,6 +85,7 @@ towire_dname(ARGS_TOWIRE) {
isc_region_t region; isc_region_t region;
REQUIRE(rdata->type == 39); REQUIRE(rdata->type == 39);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE); dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL); dns_name_init(&name, NULL);
...@@ -103,6 +105,8 @@ compare_dname(ARGS_COMPARE) { ...@@ -103,6 +105,8 @@ compare_dname(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type); REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass); REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 39); REQUIRE(rdata1->type == 39);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL); dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL); dns_name_init(&name2, NULL);
...@@ -138,6 +142,7 @@ tostruct_dname(ARGS_TOSTRUCT) { ...@@ -138,6 +142,7 @@ tostruct_dname(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 39); REQUIRE(rdata->type == 39);
REQUIRE(target != NULL); REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
dname->common.rdclass = rdata->rdclass; dname->common.rdclass = rdata->rdclass;
dname->common.rdtype = rdata->type; dname->common.rdtype = rdata->type;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: gpos_27.c,v 1.24 2000/08/01 01:25:15 tale Exp $ */ /* $Id: gpos_27.c,v 1.25 2000/10/25 05:43:31 marka Exp $ */
/* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */ /* reviewed: Wed Mar 15 16:48:45 PST 2000 by brister */
...@@ -51,6 +51,7 @@ totext_gpos(ARGS_TOTEXT) { ...@@ -51,6 +51,7 @@ totext_gpos(ARGS_TOTEXT) {
int i; int i;
REQUIRE(rdata->type == 27); REQUIRE(rdata->type == 27);
REQUIRE(rdata->length != 0);
UNUSED(tctx); UNUSED(tctx);
...@@ -84,6 +85,7 @@ static inline isc_result_t ...@@ -84,6 +85,7 @@ static inline isc_result_t
towire_gpos(ARGS_TOWIRE) { towire_gpos(ARGS_TOWIRE) {
REQUIRE(rdata->type == 27); REQUIRE(rdata->type == 27);
REQUIRE(rdata->length != 0);
UNUSED(cctx); UNUSED(cctx);
...@@ -98,6 +100,8 @@ compare_gpos(ARGS_COMPARE) { ...@@ -98,6 +100,8 @@ compare_gpos(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type); REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass); REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 27); REQUIRE(rdata1->type == 27);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1); dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2); dns_rdata_toregion(rdata2, &r2);
...@@ -128,6 +132,7 @@ tostruct_gpos(ARGS_TOSTRUCT) { ...@@ -128,6 +132,7 @@ tostruct_gpos(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 27); REQUIRE(rdata->type == 27);
REQUIRE(target != NULL); REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
gpos->common.rdclass = rdata->rdclass; gpos->common.rdclass = rdata->rdclass;
gpos->common.rdtype = rdata->type; gpos->common.rdtype = rdata->type;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: hinfo_13.c,v 1.29 2000/08/01 01:25:17 tale Exp $ */ /* $Id: hinfo_13.c,v 1.30 2000/10/25 05:43:33 marka Exp $ */
/* /*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
...@@ -52,6 +52,7 @@ totext_hinfo(ARGS_TOTEXT) { ...@@ -52,6 +52,7 @@ totext_hinfo(ARGS_TOTEXT) {
UNUSED(tctx); UNUSED(tctx);
REQUIRE(rdata->type == 13); REQUIRE(rdata->type == 13);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &region); dns_rdata_toregion(rdata, &region);
RETERR(txt_totext(&region, target)); RETERR(txt_totext(&region, target));
...@@ -78,6 +79,7 @@ towire_hinfo(ARGS_TOWIRE) { ...@@ -78,6 +79,7 @@ towire_hinfo(ARGS_TOWIRE) {
UNUSED(cctx); UNUSED(cctx);
REQUIRE(rdata->type == 13); REQUIRE(rdata->type == 13);
REQUIRE(rdata->length != 0);
return (mem_tobuffer(target, rdata->data, rdata->length)); return (mem_tobuffer(target, rdata->data, rdata->length));
} }
...@@ -90,6 +92,8 @@ compare_hinfo(ARGS_COMPARE) { ...@@ -90,6 +92,8 @@ compare_hinfo(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type); REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass); REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 13); REQUIRE(rdata1->type == 13);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1); dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2); dns_rdata_toregion(rdata2, &r2);
...@@ -118,6 +122,7 @@ tostruct_hinfo(ARGS_TOSTRUCT) { ...@@ -118,6 +122,7 @@ tostruct_hinfo(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 13); REQUIRE(rdata->type == 13);
REQUIRE(target != NULL); REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
hinfo->common.rdclass = rdata->rdclass; hinfo->common.rdclass = rdata->rdclass;
hinfo->common.rdtype = rdata->type; hinfo->common.rdtype = rdata->type;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: isdn_20.c,v 1.22 2000/08/01 01:25:19 tale Exp $ */ /* $Id: isdn_20.c,v 1.23 2000/10/25 05:43:34 marka Exp $ */
/* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */ /* Reviewed: Wed Mar 15 16:53:11 PST 2000 by bwelling */
...@@ -57,6 +57,7 @@ totext_isdn(ARGS_TOTEXT) { ...@@ -57,6 +57,7 @@ totext_isdn(ARGS_TOTEXT) {
UNUSED(tctx); UNUSED(tctx);
REQUIRE(rdata->type == 20); REQUIRE(rdata->type == 20);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &region); dns_rdata_toregion(rdata, &region);
RETERR(txt_totext(&region, target)); RETERR(txt_totext(&region, target));
...@@ -85,6 +86,7 @@ towire_isdn(ARGS_TOWIRE) { ...@@ -85,6 +86,7 @@ towire_isdn(ARGS_TOWIRE) {
UNUSED(cctx); UNUSED(cctx);
REQUIRE(rdata->type == 20); REQUIRE(rdata->type == 20);
REQUIRE(rdata->length != 0);
return (mem_tobuffer(target, rdata->data, rdata->length)); return (mem_tobuffer(target, rdata->data, rdata->length));
} }
...@@ -97,6 +99,8 @@ compare_isdn(ARGS_COMPARE) { ...@@ -97,6 +99,8 @@ compare_isdn(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type); REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass); REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 20); REQUIRE(rdata1->type == 20);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1); dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2); dns_rdata_toregion(rdata2, &r2);
...@@ -125,6 +129,7 @@ tostruct_isdn(ARGS_TOSTRUCT) { ...@@ -125,6 +129,7 @@ tostruct_isdn(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 20); REQUIRE(rdata->type == 20);
REQUIRE(target != NULL); REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
isdn->common.rdclass = rdata->rdclass; isdn->common.rdclass = rdata->rdclass;
isdn->common.rdtype = rdata->type; isdn->common.rdtype = rdata->type;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: key_25.c,v 1.31 2000/09/08 14:23:43 bwelling Exp $ */ /* $Id: key_25.c,v 1.32 2000/10/25 05:43:36 marka Exp $ */
/* /*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley. * Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
...@@ -73,6 +73,7 @@ totext_key(ARGS_TOTEXT) { ...@@ -73,6 +73,7 @@ totext_key(ARGS_TOTEXT) {
unsigned char algorithm; unsigned char algorithm;
REQUIRE(rdata->type == 25); REQUIRE(rdata->type == 25);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &sr); dns_rdata_toregion(rdata, &sr);
...@@ -144,6 +145,7 @@ towire_key(ARGS_TOWIRE) { ...@@ -144,6 +145,7 @@ towire_key(ARGS_TOWIRE) {
UNUSED(cctx); UNUSED(cctx);
REQUIRE(rdata->type == 25); REQUIRE(rdata->type == 25);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &sr); dns_rdata_toregion(rdata, &sr);
return (mem_tobuffer(target, sr.base, sr.length)); return (mem_tobuffer(target, sr.base, sr.length));
...@@ -157,6 +159,8 @@ compare_key(ARGS_COMPARE) { ...@@ -157,6 +159,8 @@ compare_key(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);