Commit 5323ed87 authored by Ondřej Surý's avatar Ondřej Surý

Merge branch 'cppcheck-1.90-warnings-v9_11' into 'v9_11'

Cppcheck 1.90 warnings v9 11

See merge request !3001
parents 3f68ed9a ea477e11
Pipeline #33340 passed with stages
in 1 minute and 41 seconds
......@@ -1333,7 +1333,7 @@ free_element(isc_mem_t *mctx, struct nsec3_chain_fixed *e) {
}
static bool
checknext(const struct nsec3_chain_fixed *first,
_checknext(const struct nsec3_chain_fixed *first,
const struct nsec3_chain_fixed *e)
{
char buf[512];
......@@ -1371,6 +1371,35 @@ checknext(const struct nsec3_chain_fixed *first,
return (false);
}
static inline bool
checknext(isc_mem_t *mctx,
const struct nsec3_chain_fixed *first,
struct nsec3_chain_fixed *prev,
const struct nsec3_chain_fixed *cur)
{
bool result = _checknext(prev, cur);
if (prev != first) {
free_element(mctx, prev);
}
return (result);
}
static inline bool
checklast(isc_mem_t *mctx,
struct nsec3_chain_fixed *first,
struct nsec3_chain_fixed *prev)
{
bool result = _checknext(prev, first);
if (prev != first) {
free_element(mctx, prev);
}
free_element(mctx, first);
return (result);
}
#define EXPECTEDANDFOUND "Expected and found NSEC3 chains not equal\n"
static isc_result_t
......@@ -1415,32 +1444,27 @@ verify_nsec3_chains(isc_mem_t *mctx) {
fprintf(stderr, EXPECTEDANDFOUND);
result = ISC_R_FAILURE;
}
if (first == NULL || newchain(first, e)) {
if (prev != NULL) {
if (!checknext(prev, first))
result = ISC_R_FAILURE;
if (prev != first)
free_element(mctx, prev);
if (first == NULL) {
prev = first = e;
} else if (newchain(first, e)) {
if (!checklast(mctx, first, prev)) {
result = ISC_R_FAILURE;
}
if (first != NULL)
free_element(mctx, first);
prev = first = e;
continue;
} else {
if (!checknext(mctx, first, prev, e)) {
result = ISC_R_FAILURE;
}
prev = e;
}
if (!checknext(prev, e))
result = ISC_R_FAILURE;
if (prev != first)
free_element(mctx, prev);
prev = e;
}
if (prev != NULL) {
if (!checknext(prev, first))
if (!checklast(mctx, first, prev))
result = ISC_R_FAILURE;
if (prev != first)
free_element(mctx, prev);
}
if (first != NULL)
free_element(mctx, first);
do {
if (f != NULL) {
if (result == ISC_R_SUCCESS) {
......
......@@ -71,10 +71,8 @@ static const dns_master_style_t *style = &dns_master_style_debug;
static void
senddone(isc_task_t *task, isc_event_t *event) {
isc_socketevent_t *sevent = (isc_socketevent_t *)event;
REQUIRE(sevent != NULL);
REQUIRE(sevent->ev_type == ISC_SOCKEVENT_SENDDONE);
REQUIRE(event != NULL);
REQUIRE(event->ev_type == ISC_SOCKEVENT_SENDDONE);
REQUIRE(task == task1);
printf("senddone\n");
......@@ -84,15 +82,17 @@ senddone(isc_task_t *task, isc_event_t *event) {
static void
recvdone(isc_task_t *task, isc_event_t *event) {
isc_socketevent_t *sevent = (isc_socketevent_t *)event;
isc_socketevent_t *sevent;
isc_buffer_t source;
isc_result_t result;
dns_message_t *response;
REQUIRE(sevent != NULL);
REQUIRE(sevent->ev_type == ISC_SOCKEVENT_RECVDONE);
REQUIRE(event != NULL);
REQUIRE(event->ev_type == ISC_SOCKEVENT_RECVDONE);
REQUIRE(task == task1);
sevent = (isc_socketevent_t *)event;
printf("recvdone\n");
if (sevent->result != ISC_R_SUCCESS) {
printf("failed\n");
......
......@@ -3088,7 +3088,9 @@ resign_fromlist(dns_rdatalist_t *this, dns_loadctx_t *lctx) {
else
when = sig.timeexpire - lctx->resign;
/* cppcheck-suppress nullPointerRedundantCheck */
rdata = ISC_LIST_NEXT(rdata, link);
/* cppcheck-suppress nullPointerRedundantCheck */
while (rdata != NULL) {
(void)dns_rdata_tostruct(rdata, &sig, NULL);
if (isc_serial_gt(sig.timesigned, lctx->now))
......@@ -3203,8 +3205,9 @@ load_quantum(isc_task_t *task, isc_event_t *event) {
dns_loadctx_t *lctx;
REQUIRE(event != NULL);
REQUIRE(DNS_LCTX_VALID(event->ev_arg));
lctx = event->ev_arg;
REQUIRE(DNS_LCTX_VALID(lctx));
if (lctx->canceled)
result = ISC_R_CANCELED;
......
......@@ -1218,8 +1218,11 @@ dns_rdata_tostruct(const dns_rdata_t *rdata, void *target, isc_mem_t *mctx) {
void
dns_rdata_freestruct(void *source) {
dns_rdatacommon_t *common = source;
REQUIRE(common != NULL);
dns_rdatacommon_t *common;
REQUIRE(source != NULL);
common = source;
FREESTRUCTSWITCH
}
......
......@@ -353,14 +353,16 @@ compare_any_tsig(ARGS_COMPARE) {
static inline isc_result_t
fromstruct_any_tsig(ARGS_FROMSTRUCT) {
dns_rdata_any_tsig_t *tsig = source;
dns_rdata_any_tsig_t *tsig;
isc_region_t tr;
REQUIRE(type == dns_rdatatype_tsig);
REQUIRE(rdclass == dns_rdataclass_any);
REQUIRE(tsig != NULL);
REQUIRE(tsig->common.rdclass == rdclass);
REQUIRE(tsig->common.rdtype == type);
REQUIRE(((dns_rdata_any_tsig_t *)source) != NULL);
REQUIRE(((dns_rdata_any_tsig_t *)source)->common.rdclass == rdclass);
REQUIRE(((dns_rdata_any_tsig_t *)source)->common.rdtype == type);
tsig = source;
UNUSED(type);
UNUSED(rdclass);
......@@ -521,11 +523,13 @@ tostruct_any_tsig(ARGS_TOSTRUCT) {
static inline void
freestruct_any_tsig(ARGS_FREESTRUCT) {
dns_rdata_any_tsig_t *tsig = (dns_rdata_any_tsig_t *) source;
dns_rdata_any_tsig_t *tsig;
REQUIRE(((dns_rdata_any_tsig_t *)source) != NULL);
REQUIRE(((dns_rdata_any_tsig_t *)source)->common.rdtype == dns_rdatatype_tsig);
REQUIRE(((dns_rdata_any_tsig_t *)source)->common.rdclass == dns_rdataclass_any);
REQUIRE(tsig != NULL);
REQUIRE(tsig->common.rdtype == dns_rdatatype_tsig);
REQUIRE(tsig->common.rdclass == dns_rdataclass_any);
tsig = (dns_rdata_any_tsig_t *) source;
if (tsig->mctx == NULL)
return;
......
......@@ -187,13 +187,15 @@ compare_ch_a(ARGS_COMPARE) {
static inline isc_result_t
fromstruct_ch_a(ARGS_FROMSTRUCT) {
dns_rdata_ch_a_t *a = source;
dns_rdata_ch_a_t *a;
isc_region_t region;
REQUIRE(type == dns_rdatatype_a);
REQUIRE(a != NULL);
REQUIRE(a->common.rdtype == type);
REQUIRE(a->common.rdclass == rdclass);
REQUIRE(((dns_rdata_ch_a_t *)source) != NULL);
REQUIRE(((dns_rdata_ch_a_t *)source)->common.rdtype == type);
REQUIRE(((dns_rdata_ch_a_t *)source)->common.rdclass == rdclass);
a = source;
UNUSED(type);
UNUSED(rdclass);
......@@ -206,7 +208,7 @@ fromstruct_ch_a(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_ch_a(ARGS_TOSTRUCT) {
dns_rdata_ch_a_t *a = target;
dns_rdata_ch_a_t *a;
isc_region_t region;
dns_name_t name;
......@@ -214,6 +216,8 @@ tostruct_ch_a(ARGS_TOSTRUCT) {
REQUIRE(rdata->rdclass == dns_rdataclass_ch);
REQUIRE(rdata->length != 0);
a = target;
a->common.rdclass = rdata->rdclass;
a->common.rdtype = rdata->type;
ISC_LINK_INIT(&a->common, link);
......@@ -233,10 +237,12 @@ tostruct_ch_a(ARGS_TOSTRUCT) {
static inline void
freestruct_ch_a(ARGS_FREESTRUCT) {
dns_rdata_ch_a_t *a = source;
dns_rdata_ch_a_t *a;
REQUIRE(((dns_rdata_ch_a_t *)source) != NULL);
REQUIRE(((dns_rdata_ch_a_t *)source)->common.rdtype == dns_rdatatype_a);
REQUIRE(a != NULL);
REQUIRE(a->common.rdtype == dns_rdatatype_a);
a = source;
if (a->mctx == NULL)
return;
......
......@@ -170,13 +170,15 @@ compare_afsdb(ARGS_COMPARE) {
static inline isc_result_t
fromstruct_afsdb(ARGS_FROMSTRUCT) {
dns_rdata_afsdb_t *afsdb = source;
dns_rdata_afsdb_t *afsdb;
isc_region_t region;
REQUIRE(type == dns_rdatatype_afsdb);
REQUIRE(afsdb != NULL);
REQUIRE(afsdb->common.rdclass == rdclass);
REQUIRE(afsdb->common.rdtype == type);
REQUIRE(((dns_rdata_afsdb_t *)source) != NULL);
REQUIRE(((dns_rdata_afsdb_t *)source)->common.rdclass == rdclass);
REQUIRE(((dns_rdata_afsdb_t *)source)->common.rdtype == type);
afsdb = source;
UNUSED(type);
UNUSED(rdclass);
......@@ -189,13 +191,15 @@ fromstruct_afsdb(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_afsdb(ARGS_TOSTRUCT) {
isc_region_t region;
dns_rdata_afsdb_t *afsdb = target;
dns_rdata_afsdb_t *afsdb;
dns_name_t name;
REQUIRE(((dns_rdata_afsdb_t *)target) != NULL);
REQUIRE(rdata->type == dns_rdatatype_afsdb);
REQUIRE(afsdb != NULL);
REQUIRE(rdata->length != 0);
afsdb = target;
afsdb->common.rdclass = rdata->rdclass;
afsdb->common.rdtype = rdata->type;
ISC_LINK_INIT(&afsdb->common, link);
......@@ -217,10 +221,13 @@ tostruct_afsdb(ARGS_TOSTRUCT) {
static inline void
freestruct_afsdb(ARGS_FREESTRUCT) {
dns_rdata_afsdb_t *afsdb = source;
dns_rdata_afsdb_t *afsdb;
REQUIRE(((dns_rdata_afsdb_t *)source) != NULL);
REQUIRE(((dns_rdata_afsdb_t *)source)->common.rdtype ==
dns_rdatatype_afsdb);
REQUIRE(afsdb != NULL);
REQUIRE(afsdb->common.rdtype == dns_rdatatype_afsdb);
afsdb = source;
if (afsdb->mctx == NULL)
return;
......
......@@ -264,14 +264,16 @@ compare_amtrelay(ARGS_COMPARE) {
static inline isc_result_t
fromstruct_amtrelay(ARGS_FROMSTRUCT) {
dns_rdata_amtrelay_t *amtrelay = source;
dns_rdata_amtrelay_t *amtrelay;
isc_region_t region;
uint32_t n;
REQUIRE(type == dns_rdatatype_amtrelay);
REQUIRE(amtrelay != NULL);
REQUIRE(amtrelay->common.rdtype == type);
REQUIRE(amtrelay->common.rdclass == rdclass);
REQUIRE(((dns_rdata_amtrelay_t *)source) != NULL);
REQUIRE(((dns_rdata_amtrelay_t *)source)->common.rdtype == type);
REQUIRE(((dns_rdata_amtrelay_t *)source)->common.rdclass == rdclass);
amtrelay = source;
UNUSED(type);
UNUSED(rdclass);
......@@ -305,14 +307,16 @@ fromstruct_amtrelay(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_amtrelay(ARGS_TOSTRUCT) {
isc_region_t region;
dns_rdata_amtrelay_t *amtrelay = target;
dns_rdata_amtrelay_t *amtrelay;
dns_name_t name;
uint32_t n;
REQUIRE(((dns_rdata_amtrelay_t *)target) != NULL);
REQUIRE(rdata->type == dns_rdatatype_amtrelay);
REQUIRE(amtrelay != NULL);
REQUIRE(rdata->length >= 2);
amtrelay = target;
amtrelay->common.rdclass = rdata->rdclass;
amtrelay->common.rdtype = rdata->type;
ISC_LINK_INIT(&amtrelay->common, link);
......@@ -368,10 +372,13 @@ tostruct_amtrelay(ARGS_TOSTRUCT) {
static inline void
freestruct_amtrelay(ARGS_FREESTRUCT) {
dns_rdata_amtrelay_t *amtrelay = source;
dns_rdata_amtrelay_t *amtrelay;
REQUIRE(((dns_rdata_amtrelay_t *)source) != NULL);
REQUIRE(((dns_rdata_amtrelay_t *)source)->common.rdtype ==
dns_rdatatype_amtrelay);
REQUIRE(amtrelay != NULL);
REQUIRE(amtrelay->common.rdtype == dns_rdatatype_amtrelay);
amtrelay = source;
if (amtrelay->mctx == NULL)
return;
......
......@@ -87,10 +87,12 @@ fromstruct_avc(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_avc(ARGS_TOSTRUCT) {
dns_rdata_avc_t *avc = target;
dns_rdata_avc_t *avc;
REQUIRE(((dns_rdata_avc_t *)target) != NULL);
REQUIRE(rdata->type == dns_rdatatype_avc);
REQUIRE(avc != NULL);
avc = target;
avc->common.rdclass = rdata->rdclass;
avc->common.rdtype = rdata->type;
......@@ -101,10 +103,8 @@ tostruct_avc(ARGS_TOSTRUCT) {
static inline void
freestruct_avc(ARGS_FREESTRUCT) {
dns_rdata_avc_t *avc = source;
REQUIRE(avc != NULL);
REQUIRE(avc->common.rdtype == dns_rdatatype_avc);
REQUIRE(((dns_rdata_avc_t *)source) != NULL);
REQUIRE(((dns_rdata_avc_t *)source)->common.rdtype == dns_rdatatype_avc);
generic_freestruct_txt(source);
}
......
......@@ -191,16 +191,19 @@ compare_caa(ARGS_COMPARE) {
static inline isc_result_t
fromstruct_caa(ARGS_FROMSTRUCT) {
dns_rdata_caa_t *caa = source;
dns_rdata_caa_t *caa;
isc_region_t region;
unsigned int i;
REQUIRE(type == dns_rdatatype_caa);
REQUIRE(caa != NULL);
REQUIRE(caa->common.rdtype == type);
REQUIRE(caa->common.rdclass == rdclass);
REQUIRE(caa->tag != NULL && caa->tag_len != 0);
REQUIRE(caa->value != NULL);
REQUIRE(((dns_rdata_caa_t *)source) != NULL);
REQUIRE(((dns_rdata_caa_t *)source)->common.rdtype == type);
REQUIRE(((dns_rdata_caa_t *)source)->common.rdclass == rdclass);
REQUIRE(((dns_rdata_caa_t *)source)->tag != NULL);
REQUIRE(((dns_rdata_caa_t *)source)->tag_len != 0);
REQUIRE(((dns_rdata_caa_t *)source)->value != NULL);
caa = source;
UNUSED(type);
UNUSED(rdclass);
......@@ -235,14 +238,16 @@ fromstruct_caa(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_caa(ARGS_TOSTRUCT) {
dns_rdata_caa_t *caa = target;
dns_rdata_caa_t *caa;
isc_region_t sr;
REQUIRE(((dns_rdata_caa_t *)target) != NULL);
REQUIRE(rdata->type == dns_rdatatype_caa);
REQUIRE(caa != NULL);
REQUIRE(rdata->length >= 3U);
REQUIRE(rdata->data != NULL);
caa = target;
caa->common.rdclass = rdata->rdclass;
caa->common.rdtype = rdata->type;
ISC_LINK_INIT(&caa->common, link);
......@@ -289,10 +294,13 @@ tostruct_caa(ARGS_TOSTRUCT) {
static inline void
freestruct_caa(ARGS_FREESTRUCT) {
dns_rdata_caa_t *caa = (dns_rdata_caa_t *) source;
dns_rdata_caa_t *caa;
REQUIRE(((dns_rdata_caa_t *)source) != NULL);
REQUIRE(((dns_rdata_caa_t *)source)->common.rdtype ==
dns_rdatatype_caa);
REQUIRE(caa != NULL);
REQUIRE(caa->common.rdtype == dns_rdatatype_caa);
caa = source;
if (caa->mctx == NULL)
return;
......
......@@ -86,12 +86,14 @@ fromstruct_cdnskey(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_cdnskey(ARGS_TOSTRUCT) {
dns_rdata_cdnskey_t *dnskey = target;
dns_rdata_cdnskey_t *dnskey;
REQUIRE(dnskey != NULL);
REQUIRE(((dns_rdata_cdnskey_t *)target) != NULL);
REQUIRE(rdata != NULL);
REQUIRE(rdata->type == dns_rdatatype_cdnskey);
dnskey = target;
dnskey->common.rdclass = rdata->rdclass;
dnskey->common.rdtype = rdata->type;
ISC_LINK_INIT(&dnskey->common, link);
......@@ -101,10 +103,9 @@ tostruct_cdnskey(ARGS_TOSTRUCT) {
static inline void
freestruct_cdnskey(ARGS_FREESTRUCT) {
dns_rdata_cdnskey_t *dnskey = (dns_rdata_cdnskey_t *) source;
REQUIRE(dnskey != NULL);
REQUIRE(dnskey->common.rdtype == dns_rdatatype_cdnskey);
REQUIRE(((dns_rdata_cdnskey_t *)source) != NULL);
REQUIRE(((dns_rdata_cdnskey_t *)source)->common.rdtype ==
dns_rdatatype_cdnskey);
generic_freestruct_key(source);
}
......
......@@ -88,12 +88,14 @@ fromstruct_cds(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_cds(ARGS_TOSTRUCT) {
dns_rdata_cds_t *cds = target;
dns_rdata_cds_t *cds;
REQUIRE(((dns_rdata_cds_t *)target) != NULL);
REQUIRE(rdata->type == dns_rdatatype_cds);
REQUIRE(cds != NULL);
REQUIRE(rdata->length != 0);
cds = target;
/*
* Checked by generic_tostruct_ds().
*/
......@@ -106,10 +108,13 @@ tostruct_cds(ARGS_TOSTRUCT) {
static inline void
freestruct_cds(ARGS_FREESTRUCT) {
dns_rdata_cds_t *cds = source;
dns_rdata_cds_t *cds;
REQUIRE(((dns_rdata_cds_t *)source) != NULL);
REQUIRE(((dns_rdata_cds_t *)source)->common.rdtype ==
dns_rdatatype_cds);
REQUIRE(cds != NULL);
REQUIRE(cds->common.rdtype == dns_rdatatype_cds);
cds = source;
if (cds->mctx == NULL) {
return;
......
......@@ -159,12 +159,14 @@ compare_cert(ARGS_COMPARE) {
static inline isc_result_t
fromstruct_cert(ARGS_FROMSTRUCT) {
dns_rdata_cert_t *cert = source;
dns_rdata_cert_t *cert;
REQUIRE(type == dns_rdatatype_cert);
REQUIRE(cert != NULL);
REQUIRE(cert->common.rdtype == type);
REQUIRE(cert->common.rdclass == rdclass);
REQUIRE(((dns_rdata_cert_t *)source) != NULL);
REQUIRE(((dns_rdata_cert_t *)source)->common.rdtype == type);
REQUIRE(((dns_rdata_cert_t *)source)->common.rdclass == rdclass);
cert = source;
UNUSED(type);
UNUSED(rdclass);
......@@ -178,13 +180,15 @@ fromstruct_cert(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_cert(ARGS_TOSTRUCT) {
dns_rdata_cert_t *cert = target;
dns_rdata_cert_t *cert;
isc_region_t region;
REQUIRE(((dns_rdata_cert_t *)target) != NULL);
REQUIRE(rdata->type == dns_rdatatype_cert);
REQUIRE(cert != NULL);
REQUIRE(rdata->length != 0);
cert = target;
cert->common.rdclass = rdata->rdclass;
cert->common.rdtype = rdata->type;
ISC_LINK_INIT(&cert->common, link);
......@@ -209,10 +213,13 @@ tostruct_cert(ARGS_TOSTRUCT) {
static inline void
freestruct_cert(ARGS_FREESTRUCT) {
dns_rdata_cert_t *cert = source;
dns_rdata_cert_t *cert;
REQUIRE(((dns_rdata_cert_t *)source) != NULL);
REQUIRE(((dns_rdata_cert_t *)source)->common.rdtype ==
dns_rdatatype_cert);
REQUIRE(cert != NULL);
REQUIRE(cert->common.rdtype == dns_rdatatype_cert);
cert = source;
if (cert->mctx == NULL)
return;
......
......@@ -119,13 +119,15 @@ compare_cname(ARGS_COMPARE) {
static inline isc_result_t
fromstruct_cname(ARGS_FROMSTRUCT) {
dns_rdata_cname_t *cname = source;
dns_rdata_cname_t *cname;
isc_region_t region;
REQUIRE(type == dns_rdatatype_cname);
REQUIRE(cname != NULL);
REQUIRE(cname->common.rdtype == type);
REQUIRE(cname->common.rdclass == rdclass);
REQUIRE(((dns_rdata_cname_t *)source) != NULL);
REQUIRE(((dns_rdata_cname_t *)source)->common.rdtype == type);
REQUIRE(((dns_rdata_cname_t *)source)->common.rdclass == rdclass);
cname = source;
UNUSED(type);
UNUSED(rdclass);
......@@ -137,13 +139,15 @@ fromstruct_cname(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_cname(ARGS_TOSTRUCT) {
isc_region_t region;
dns_rdata_cname_t *cname = target;
dns_rdata_cname_t *cname;
dns_name_t name;
REQUIRE(((dns_rdata_cname_t *)target) != NULL);
REQUIRE(rdata->type == dns_rdatatype_cname);
REQUIRE(cname != NULL);
REQUIRE(rdata->length != 0);
cname = target;
cname->common.rdclass = rdata->rdclass;
cname->common.rdtype = rdata->type;
ISC_LINK_INIT(&cname->common, link);
......@@ -159,9 +163,11 @@ tostruct_cname(ARGS_TOSTRUCT) {
static inline void
freestruct_cname(ARGS_FREESTRUCT) {
dns_rdata_cname_t *cname = source;
dns_rdata_cname_t *cname;
REQUIRE(((dns_rdata_cname_t *)source) != NULL);
REQUIRE(cname != NULL);
cname = source;
if (cname->mctx == NULL)
return;
......
......@@ -136,14 +136,17 @@ compare_csync(ARGS_COMPARE) {
static inline isc_result_t
fromstruct_csync(ARGS_FROMSTRUCT) {
dns_rdata_csync_t *csync = source;
dns_rdata_csync_t *csync;
isc_region_t region;
REQUIRE(type == dns_rdatatype_csync);
REQUIRE(csync != NULL);
REQUIRE(csync->common.rdtype == type);
REQUIRE(csync->common.rdclass == rdclass);
REQUIRE(csync->typebits != NULL || csync->len == 0);
REQUIRE(((dns_rdata_csync_t *)source) != NULL);
REQUIRE(((dns_rdata_csync_t *)source)->common.rdtype == type);
REQUIRE(((dns_rdata_csync_t *)source)->common.rdclass == rdclass);
REQUIRE(((dns_rdata_csync_t *)source)->typebits != NULL ||
((dns_rdata_csync_t *)source)->len == 0);
csync = source;
UNUSED(type);
UNUSED(rdclass);
......@@ -160,12 +163,14 @@ fromstruct_csync(ARGS_FROMSTRUCT) {
static inline isc_result_t
tostruct_csync(ARGS_TOSTRUCT) {
isc_region_t region;
dns_rdata_csync_t *csync = target;
dns_rdata_csync_t *csync;
REQUIRE(((dns_rdata_csync_t *)target) != NULL);
REQUIRE(rdata->type == dns_rdatatype_csync);
REQUIRE(csync != NULL);
REQUIRE(rdata->length != 0);
csync = target;
csync->common.rdclass = rdata->rdclass;
csync->common.rdtype = rdata->type;