2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

REQUIRE that rataset/rdatalist be non NULL

This commit is contained in:
Mark Andrews 2010-11-16 00:50:28 +00:00
parent a158495f84
commit c5a3400f23

View File

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdatalist.c,v 1.38 2010/02/25 05:08:01 tbox Exp $ */
/* $Id: rdatalist.c,v 1.39 2010/11/16 00:50:28 marka Exp $ */
/*! \file */
@ -54,6 +54,8 @@ static dns_rdatasetmethods_t methods = {
void
dns_rdatalist_init(dns_rdatalist_t *rdatalist) {
REQUIRE(rdatalist != NULL);
/*
* Initialize rdatalist.
*/
@ -125,6 +127,8 @@ isc_result_t
isc__rdatalist_next(dns_rdataset_t *rdataset) {
dns_rdata_t *rdata;
REQUIRE(rdataset != NULL);
rdata = rdataset->private2;
if (rdata == NULL)
return (ISC_R_NOMORE);
@ -141,6 +145,8 @@ void
isc__rdatalist_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata) {
dns_rdata_t *list_rdata;
REQUIRE(rdataset != NULL);
list_rdata = rdataset->private2;
INSIST(list_rdata != NULL);
@ -149,6 +155,10 @@ isc__rdatalist_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata) {
void
isc__rdatalist_clone(dns_rdataset_t *source, dns_rdataset_t *target) {
REQUIRE(source != NULL);
REQUIRE(target != NULL);
*target = *source;
/*
@ -163,6 +173,8 @@ isc__rdatalist_count(dns_rdataset_t *rdataset) {
dns_rdata_t *rdata;
unsigned int count;
REQUIRE(rdataset != NULL);
rdatalist = rdataset->private1;
count = 0;
@ -181,6 +193,8 @@ isc__rdatalist_addnoqname(dns_rdataset_t *rdataset, dns_name_t *name) {
dns_rdataset_t *rdset;
dns_ttl_t ttl;
REQUIRE(rdataset != NULL);
for (rdset = ISC_LIST_HEAD(name->list);
rdset != NULL;
rdset = ISC_LIST_NEXT(rdset, link))
@ -228,7 +242,9 @@ isc__rdatalist_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
dns_rdataset_t *tnegsig = NULL;
dns_name_t *noqname = rdataset->private6;
REQUIRE(rdataset != NULL);
REQUIRE((rdataset->attributes & DNS_RDATASETATTR_NOQNAME) != 0);
(void)dns_name_dynamic(noqname); /* Sanity Check. */
for (rdataset = ISC_LIST_HEAD(noqname->list);
@ -268,6 +284,8 @@ isc__rdatalist_addclosest(dns_rdataset_t *rdataset, dns_name_t *name) {
dns_rdataset_t *rdset;
dns_ttl_t ttl;
REQUIRE(rdataset != NULL);
for (rdset = ISC_LIST_HEAD(name->list);
rdset != NULL;
rdset = ISC_LIST_NEXT(rdset, link))
@ -315,7 +333,9 @@ isc__rdatalist_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
dns_rdataset_t *tnegsig = NULL;
dns_name_t *closest = rdataset->private7;
REQUIRE(rdataset != NULL);
REQUIRE((rdataset->attributes & DNS_RDATASETATTR_CLOSEST) != 0);
(void)dns_name_dynamic(closest); /* Sanity Check. */
for (rdataset = ISC_LIST_HEAD(closest->list);