clang compiler warnings + 1 bug!

Bug is countring insecure answers in util-internal.c
found by clang warning reporting
This commit is contained in:
Willem Toorop 2015-07-08 13:07:24 +02:00
parent 2918c8b472
commit 201b6af9a2
6 changed files with 42 additions and 39 deletions

View File

@ -70,7 +70,7 @@ struct getdns_dict
struct mem_funcs mf;
};
inline struct getdns_dict *_getdns_dict_create_with_mf(struct mem_funcs *mf)
inline static getdns_dict *_getdns_dict_create_with_mf(struct mem_funcs *mf)
{ return getdns_dict_create_with_extended_memory_functions(
mf->mf_arg, mf->mf.ext.malloc, mf->mf.ext.realloc, mf->mf.ext.free); }

View File

@ -1329,10 +1329,10 @@ static ldns_rr *rr2ldns_rr(priv_getdns_rr_iter *rr)
size_t pos = rr->pos - rr->pkt;
if (ldns_wire2rr(&rr_l, rr->pkt, rr->pkt_end - rr->pkt, &pos,
priv_getdns_rr_iter_section(rr)) == LDNS_STATUS_OK)
return rr_l;
else
(ldns_pkt_section)priv_getdns_rr_iter_section(rr)))
return NULL;
else
return rr_l;
}
static ldns_rr_list *rrset2ldns_rr_list(getdns_rrset *rrset)
@ -2685,6 +2685,9 @@ static void check_chain_complete(chain_head *chain)
dns_req_free(node->ds_req->owner);
}
if (node->soa_req) {
dns_req_free(node->soa_req->owner);
}
}
GETDNS_FREE(head->my_mf, head);
}

View File

@ -347,38 +347,38 @@ priv_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
"%hhx.%hhx.%hhx.%hhx.%hhx.%hhx.%hhx.%hhx."
"%hhx.%hhx.%hhx.%hhx.%hhx.%hhx.%hhx.%hhx."
"%hhx.%hhx.%hhx.%hhx.%hhx.%hhx.%hhx.%hhx.ip6.arpa.",
((uint8_t *)address_data->data)[15] & 0x0F,
((uint8_t *)address_data->data)[15] >> 4,
((uint8_t *)address_data->data)[14] & 0x0F,
((uint8_t *)address_data->data)[14] >> 4,
((uint8_t *)address_data->data)[13] & 0x0F,
((uint8_t *)address_data->data)[13] >> 4,
((uint8_t *)address_data->data)[12] & 0x0F,
((uint8_t *)address_data->data)[12] >> 4,
((uint8_t *)address_data->data)[11] & 0x0F,
((uint8_t *)address_data->data)[11] >> 4,
((uint8_t *)address_data->data)[10] & 0x0F,
((uint8_t *)address_data->data)[10] >> 4,
((uint8_t *)address_data->data)[9] & 0x0F,
((uint8_t *)address_data->data)[9] >> 4,
((uint8_t *)address_data->data)[8] & 0x0F,
((uint8_t *)address_data->data)[8] >> 4,
((uint8_t *)address_data->data)[7] & 0x0F,
((uint8_t *)address_data->data)[7] >> 4,
((uint8_t *)address_data->data)[6] & 0x0F,
((uint8_t *)address_data->data)[6] >> 4,
((uint8_t *)address_data->data)[5] & 0x0F,
((uint8_t *)address_data->data)[5] >> 4,
((uint8_t *)address_data->data)[4] & 0x0F,
((uint8_t *)address_data->data)[4] >> 4,
((uint8_t *)address_data->data)[3] & 0x0F,
((uint8_t *)address_data->data)[3] >> 4,
((uint8_t *)address_data->data)[2] & 0x0F,
((uint8_t *)address_data->data)[2] >> 4,
((uint8_t *)address_data->data)[1] & 0x0F,
((uint8_t *)address_data->data)[1] >> 4,
((uint8_t *)address_data->data)[0] & 0x0F,
((uint8_t *)address_data->data)[0] >> 4);
(uint8_t)(((uint8_t *)address_data->data)[15] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[15] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[14] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[14] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[13] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[13] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[12] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[12] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[11] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[11] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[10] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[10] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[9] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[9] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[8] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[8] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[7] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[7] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[6] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[6] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[5] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[5] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[4] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[4] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[3] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[3] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[2] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[2] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[1] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[1] >> 4),
(uint8_t)(((uint8_t *)address_data->data)[0] & 0x0F),
(uint8_t)(((uint8_t *)address_data->data)[0] >> 4));
break;
default:
return GETDNS_RETURN_INVALID_PARAMETER;

View File

@ -74,7 +74,7 @@ struct getdns_list
struct mem_funcs mf;
};
inline struct getdns_list *_getdns_list_create_with_mf(struct mem_funcs *mf)
inline static getdns_list *_getdns_list_create_with_mf(struct mem_funcs *mf)
{ return getdns_list_create_with_extended_memory_functions(
mf->mf_arg, mf->mf.ext.malloc, mf->mf.ext.realloc, mf->mf.ext.free); }

View File

@ -190,7 +190,7 @@ static getdns_return_t validate_chain(getdns_dict *response)
response, "replies_tree", &replies_tree)))
goto error;
fprintf(stdout, "replies_tree %zu, dnssec_status: ", i);
fprintf(stdout, "replies_tree dnssec_status: ");
switch ((s = getdns_validate_dnssec(
replies_tree, validation_chain, trust_anchor))) {

View File

@ -736,7 +736,7 @@ create_getdns_response(getdns_dns_req *completed_request)
nreplies++;
if (netreq->dnssec_status == GETDNS_DNSSEC_SECURE)
nsecure++;
else if (! netreq->dnssec_status != GETDNS_DNSSEC_BOGUS)
else if (netreq->dnssec_status != GETDNS_DNSSEC_BOGUS)
ninsecure++;
if (dnssec_return_status &&