mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2025-10-06 02:59:37 +00:00
Mark unhittable lines
Add comments for the benefit of the lcov tool, marking lines that cannot be hit. Typically these are fall-back protection arms that are already covered by earlier checks, and so it's not worth taking out the unhittable code (in case someone changes the code between the two places in future).
This commit is contained in:
@ -150,22 +150,22 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
if (addrs)
|
||||
{
|
||||
if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
|
||||
{
|
||||
{ /* LCOV_EXCL_START: already checked above */
|
||||
free(rr_name);
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
} /* LCOV_EXCL_STOP */
|
||||
memcpy(&addrs[naddrs], aptr, sizeof(struct ares_in6_addr));
|
||||
}
|
||||
if (naddrs < max_addr_ttls)
|
||||
{
|
||||
struct ares_addr6ttl * const at = &addrttls[naddrs];
|
||||
if (aptr + sizeof(struct ares_in6_addr) > abuf + alen)
|
||||
{
|
||||
{ /* LCOV_EXCL_START: already checked above */
|
||||
free(rr_name);
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
} /* LCOV_EXCL_STOP */
|
||||
memcpy(&at->ip6addr, aptr, sizeof(struct ares_in6_addr));
|
||||
at->ttl = rr_ttl;
|
||||
}
|
||||
@ -199,10 +199,10 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
||||
|
||||
aptr += rr_len;
|
||||
if (aptr > abuf + alen)
|
||||
{
|
||||
{ /* LCOV_EXCL_START: already checked above */
|
||||
status = ARES_EBADRESP;
|
||||
break;
|
||||
}
|
||||
} /* LCOV_EXCL_STOP */
|
||||
}
|
||||
|
||||
/* the check for naliases to be zero is to make sure CNAME responses
|
||||
|
Reference in New Issue
Block a user