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 @@
* 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 <ctype.h>
......@@ -515,9 +515,6 @@ dns_rdata_towire(dns_rdata_t *rdata, dns_compress_t *cctx,
INSIST(rdata->length == 0);
return (ISC_R_SUCCESS);
}
#if 0
INSIST(rdata->type == dns_rdatatype_opt || rdata->length != 0); /* XXXMPA remove */
#endif
st = *target;
......@@ -761,8 +758,10 @@ rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
/*
* 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);
}
TOTEXTSWITCH
......
......@@ -15,7 +15,7 @@
* 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 */
......@@ -26,7 +26,7 @@
(DNS_RDATATYPEATTR_META | DNS_RDATATYPEATTR_NOTQUESTION)
static inline isc_result_t
fromtext_any_tsig(ARGS_FROMTEXT) {
fromtext_any_tsig(ARGS_FROMTEXT) {
isc_token_t token;
dns_name_t name;
isc_uint64_t sigtime;
......@@ -132,6 +132,7 @@ totext_any_tsig(ARGS_TOTEXT) {
REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &sr);
/*
......@@ -297,6 +298,7 @@ towire_any_tsig(ARGS_TOWIRE) {
REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_rdata_toregion(rdata, &sr);
......@@ -319,6 +321,8 @@ compare_any_tsig(ARGS_COMPARE) {
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 250);
REQUIRE(rdata1->rdclass == 255);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
......@@ -410,6 +414,7 @@ tostruct_any_tsig(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 250);
REQUIRE(rdata->rdclass == 255);
REQUIRE(rdata->length != 0);
tsig = (dns_rdata_any_tsig_t *) target;
tsig->common.rdclass = rdata->rdclass;
......
......@@ -15,7 +15,7 @@
* 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 */
......@@ -64,6 +64,7 @@ totext_afsdb(ARGS_TOTEXT) {
unsigned int num;
REQUIRE(rdata->type == 18);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
......@@ -111,6 +112,7 @@ towire_afsdb(ARGS_TOWIRE) {
dns_name_t name;
REQUIRE(rdata->type == 18);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
isc_buffer_availableregion(target, &tr);
......@@ -138,6 +140,8 @@ compare_afsdb(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 18);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
result = memcmp(rdata1->data, rdata2->data, 2);
if (result != 0)
......@@ -181,6 +185,7 @@ tostruct_afsdb(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 18);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
afsdb->common.rdclass = rdata->rdclass;
afsdb->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* 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 */
......@@ -70,6 +70,7 @@ totext_cert(ARGS_TOTEXT) {
unsigned int n;
REQUIRE(rdata->type == 37);
REQUIRE(rdata->length != 0);
UNUSED(tctx);
......@@ -133,6 +134,7 @@ towire_cert(ARGS_TOWIRE) {
isc_region_t sr;
REQUIRE(rdata->type == 37);
REQUIRE(rdata->length != 0);
UNUSED(cctx);
......@@ -148,6 +150,8 @@ compare_cert(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 37);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
......@@ -177,6 +181,7 @@ tostruct_cert(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 37);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
cert->common.rdclass = rdata->rdclass;
cert->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* 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 */
......@@ -51,6 +51,7 @@ totext_cname(ARGS_TOTEXT) {
isc_boolean_t sub;
REQUIRE(rdata->type == 5);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
......@@ -83,6 +84,7 @@ towire_cname(ARGS_TOWIRE) {
isc_region_t region;
REQUIRE(rdata->type == 5);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
......@@ -103,6 +105,8 @@ compare_cname(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 5);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -138,6 +142,7 @@ tostruct_cname(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 5);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
cname->common.rdclass = rdata->rdclass;
cname->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* 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 */
......@@ -52,6 +52,7 @@ totext_dname(ARGS_TOTEXT) {
isc_boolean_t sub;
REQUIRE(rdata->type == 39);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
......@@ -84,6 +85,7 @@ towire_dname(ARGS_TOWIRE) {
isc_region_t region;
REQUIRE(rdata->type == 39);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL);
......@@ -103,6 +105,8 @@ compare_dname(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 39);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -138,6 +142,7 @@ tostruct_dname(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 39);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
dname->common.rdclass = rdata->rdclass;
dname->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* 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 */
......@@ -51,6 +51,7 @@ totext_gpos(ARGS_TOTEXT) {
int i;
REQUIRE(rdata->type == 27);
REQUIRE(rdata->length != 0);
UNUSED(tctx);
......@@ -84,6 +85,7 @@ static inline isc_result_t
towire_gpos(ARGS_TOWIRE) {
REQUIRE(rdata->type == 27);
REQUIRE(rdata->length != 0);
UNUSED(cctx);
......@@ -98,6 +100,8 @@ compare_gpos(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 27);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
......@@ -128,6 +132,7 @@ tostruct_gpos(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 27);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
gpos->common.rdclass = rdata->rdclass;
gpos->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* 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.
......@@ -52,6 +52,7 @@ totext_hinfo(ARGS_TOTEXT) {
UNUSED(tctx);
REQUIRE(rdata->type == 13);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &region);
RETERR(txt_totext(&region, target));
......@@ -78,6 +79,7 @@ towire_hinfo(ARGS_TOWIRE) {
UNUSED(cctx);
REQUIRE(rdata->type == 13);
REQUIRE(rdata->length != 0);
return (mem_tobuffer(target, rdata->data, rdata->length));
}
......@@ -90,6 +92,8 @@ compare_hinfo(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 13);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
......@@ -118,6 +122,7 @@ tostruct_hinfo(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 13);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
hinfo->common.rdclass = rdata->rdclass;
hinfo->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* 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 */
......@@ -57,6 +57,7 @@ totext_isdn(ARGS_TOTEXT) {
UNUSED(tctx);
REQUIRE(rdata->type == 20);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &region);
RETERR(txt_totext(&region, target));
......@@ -85,6 +86,7 @@ towire_isdn(ARGS_TOWIRE) {
UNUSED(cctx);
REQUIRE(rdata->type == 20);
REQUIRE(rdata->length != 0);
return (mem_tobuffer(target, rdata->data, rdata->length));
}
......@@ -97,6 +99,8 @@ compare_isdn(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 20);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
......@@ -125,6 +129,7 @@ tostruct_isdn(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 20);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
isdn->common.rdclass = rdata->rdclass;
isdn->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* 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.
......@@ -73,6 +73,7 @@ totext_key(ARGS_TOTEXT) {
unsigned char algorithm;
REQUIRE(rdata->type == 25);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &sr);
......@@ -144,6 +145,7 @@ towire_key(ARGS_TOWIRE) {
UNUSED(cctx);
REQUIRE(rdata->type == 25);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &sr);
return (mem_tobuffer(target, sr.base, sr.length));
......@@ -157,6 +159,8 @@ compare_key(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 25);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
......@@ -192,6 +196,7 @@ tostruct_key(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 25);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
key->common.rdclass = rdata->rdclass;
key->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: loc_29.c,v 1.23 2000/08/01 01:25:24 tale Exp $ */
/* $Id: loc_29.c,v 1.24 2000/10/25 05:43:37 marka Exp $ */
/* Reviewed: Wed Mar 15 18:13:09 PST 2000 by explorer */
......@@ -433,6 +433,7 @@ totext_loc(ARGS_TOTEXT) {
UNUSED(tctx);
REQUIRE(rdata->type == 29);
REQUIRE(rdata->length != 0);
dns_rdata_toregion(rdata, &sr);
......@@ -585,6 +586,7 @@ towire_loc(ARGS_TOWIRE) {
UNUSED(cctx);
REQUIRE(rdata->type == 29);
REQUIRE(rdata->length != 0);
return (mem_tobuffer(target, rdata->data, rdata->length));
}
......@@ -597,6 +599,8 @@ compare_loc(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 29);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_rdata_toregion(rdata1, &r1);
dns_rdata_toregion(rdata2, &r2);
......@@ -652,6 +656,7 @@ tostruct_loc(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 29);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
UNUSED(mctx);
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mb_7.c,v 1.33 2000/08/01 01:25:26 tale Exp $ */
/* $Id: mb_7.c,v 1.34 2000/10/25 05:43:38 marka Exp $ */
/* Reviewed: Wed Mar 15 17:31:26 PST 2000 by bwelling */
......@@ -50,6 +50,7 @@ totext_mb(ARGS_TOTEXT) {
isc_boolean_t sub;
REQUIRE(rdata->type == 7);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
......@@ -82,6 +83,7 @@ towire_mb(ARGS_TOWIRE) {
isc_region_t region;
REQUIRE(rdata->type == 7);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
......@@ -102,6 +104,8 @@ compare_mb(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 7);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -137,6 +141,7 @@ tostruct_mb(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 7);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
mb->common.rdclass = rdata->rdclass;
mb->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: md_3.c,v 1.35 2000/08/01 01:25:28 tale Exp $ */
/* $Id: md_3.c,v 1.36 2000/10/25 05:43:39 marka Exp $ */
/* Reviewed: Wed Mar 15 17:48:20 PST 2000 by bwelling */
......@@ -50,6 +50,7 @@ totext_md(ARGS_TOTEXT) {
isc_boolean_t sub;
REQUIRE(rdata->type == 3);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
......@@ -82,6 +83,7 @@ towire_md(ARGS_TOWIRE) {
isc_region_t region;
REQUIRE(rdata->type == 3);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
......@@ -102,6 +104,8 @@ compare_md(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 3);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -137,6 +141,7 @@ tostruct_md(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 3);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
md->common.rdclass = rdata->rdclass;
md->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mf_4.c,v 1.33 2000/08/01 01:25:30 tale Exp $ */
/* $Id: mf_4.c,v 1.34 2000/10/25 05:43:40 marka Exp $ */
/* reviewed: Wed Mar 15 17:47:33 PST 2000 by brister */
......@@ -50,6 +50,7 @@ totext_mf(ARGS_TOTEXT) {
isc_boolean_t sub;
REQUIRE(rdata->type == 4);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
......@@ -82,6 +83,7 @@ towire_mf(ARGS_TOWIRE) {
isc_region_t region;
REQUIRE(rdata->type == 4);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
......@@ -102,6 +104,8 @@ compare_mf(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 4);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -137,6 +141,7 @@ tostruct_mf(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 4);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
mf->common.rdclass = rdata->rdclass;
mf->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mg_8.c,v 1.31 2000/08/01 01:25:33 tale Exp $ */
/* $Id: mg_8.c,v 1.32 2000/10/25 05:43:42 marka Exp $ */
/* reviewed: Wed Mar 15 17:49:21 PST 2000 by brister */
......@@ -50,6 +50,7 @@ totext_mg(ARGS_TOTEXT) {
isc_boolean_t sub;
REQUIRE(rdata->type == 8);
REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
......@@ -82,6 +83,7 @@ towire_mg(ARGS_TOWIRE) {
isc_region_t region;
REQUIRE(rdata->type == 8);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
......@@ -102,6 +104,8 @@ compare_mg(ARGS_COMPARE) {
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 8);
REQUIRE(rdata1->length != 0);
REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
......@@ -137,6 +141,7 @@ tostruct_mg(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 8);
REQUIRE(target != NULL);
REQUIRE(rdata->length != 0);
mg->common.rdclass = rdata->rdclass;
mg->common.rdtype = rdata->type;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: minfo_14.c,v 1.32 2000/08/01 01:25:35 tale Exp $ */
/* $Id: minfo_14.c,v 1.33 2000/10/25 05:43:43 marka Exp $ */
/* reviewed: Wed Mar 15 17:45:32 PST 2000 by brister */
......@@ -56,6 +56,7 @@ totext_minfo(ARGS_TOTEXT) {
isc_boolean_t sub;
REQUIRE(rdata->type == 14);
REQUIRE(rdata->length != 0);
dns_name_init(&rmail, NULL);
dns_name_init(&email, NULL);
......@@ -104,6 +105,7 @@ towire_minfo(ARGS_TOWIRE) {
dns_name_t email;
REQUIRE(rdata->type == 14);
REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);