summaryrefslogtreecommitdiff
path: root/lib/dns/rdata/in_1/nsap-ptr_23.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dns/rdata/in_1/nsap-ptr_23.c')
-rw-r--r--lib/dns/rdata/in_1/nsap-ptr_23.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/lib/dns/rdata/in_1/nsap-ptr_23.c b/lib/dns/rdata/in_1/nsap-ptr_23.c
index 893b046f..1b2af670 100644
--- a/lib/dns/rdata/in_1/nsap-ptr_23.c
+++ b/lib/dns/rdata/in_1/nsap-ptr_23.c
@@ -1,21 +1,21 @@
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
- *
+ *
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
+ * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+ * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: nsap-ptr_23.c,v 1.22 2000/06/01 18:26:46 tale Exp $ */
+/* $Id: nsap-ptr_23.c,v 1.27 2000/12/01 01:40:55 gson Exp $ */
/* Reviewed: Fri Mar 17 10:16:02 PST 2000 by gson */
@@ -34,8 +34,11 @@ fromtext_in_nsap_ptr(ARGS_FROMTEXT) {
REQUIRE(type == 23);
REQUIRE(rdclass == 1);
-
- RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
+
+ UNUSED(rdclass);
+
+ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
+ ISC_FALSE));
dns_name_init(&name, NULL);
buffer_fromregion(&buffer, &token.value.as_region);
@@ -52,6 +55,7 @@ totext_in_nsap_ptr(ARGS_TOTEXT) {
REQUIRE(rdata->type == 23);
REQUIRE(rdata->rdclass == 1);
+ REQUIRE(rdata->length != 0);
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
@@ -71,8 +75,10 @@ fromwire_in_nsap_ptr(ARGS_FROMWIRE) {
REQUIRE(type == 23);
REQUIRE(rdclass == 1);
+ UNUSED(rdclass);
+
dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
-
+
dns_name_init(&name, NULL);
return (dns_name_fromwire(&name, source, dctx, downcase, target));
}
@@ -84,6 +90,7 @@ towire_in_nsap_ptr(ARGS_TOWIRE) {
REQUIRE(rdata->type == 23);
REQUIRE(rdata->rdclass == 1);
+ REQUIRE(rdata->length != 0);
dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
dns_name_init(&name, NULL);
@@ -104,6 +111,8 @@ compare_in_nsap_ptr(ARGS_COMPARE) {
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 23);
REQUIRE(rdata1->rdclass == 1);
+ REQUIRE(rdata1->length != 0);
+ REQUIRE(rdata2->length != 0);
dns_name_init(&name1, NULL);
dns_name_init(&name2, NULL);
@@ -128,6 +137,8 @@ fromstruct_in_nsap_ptr(ARGS_FROMSTRUCT) {
REQUIRE(nsap_ptr->common.rdtype == type);
REQUIRE(nsap_ptr->common.rdclass == rdclass);
+ UNUSED(rdclass);
+
dns_name_toregion(&nsap_ptr->owner, &region);
return (isc_buffer_copyregion(target, &region));
}
@@ -141,6 +152,7 @@ tostruct_in_nsap_ptr(ARGS_TOSTRUCT) {
REQUIRE(rdata->type == 23);
REQUIRE(rdata->rdclass == 1);
REQUIRE(target != NULL);
+ REQUIRE(rdata->length != 0);
nsap_ptr->common.rdclass = rdata->rdclass;
nsap_ptr->common.rdtype = rdata->type;