2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Initialize adbname->client properly; check for loops

This commit is contained in:
Witold Kręcicki
2018-08-17 16:46:34 +02:00
parent 2f36a62d16
commit 86246c7431
2 changed files with 5 additions and 3 deletions

View File

@@ -1702,6 +1702,7 @@ new_adbname(dns_adb_t *adb, const dns_name_t *dnsname) {
name->fetch6_err = FIND_ERR_UNEXPECTED;
memset(&name->client, 0, sizeof(name->client));
name->id = 0;
name->client.length = 0;
ISC_LIST_INIT(name->finds);
ISC_LINK_INIT(name, plink);
@@ -3032,6 +3033,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
result = ISC_R_SHUTTINGDOWN;
goto out;
}
if (adbname != NULL && client != NULL &&
isc_sockaddr_equal(client, &adbname->client) && id == adbname->id) {
char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE];

View File

@@ -561,10 +561,10 @@ struct dns_resolver {
#define NEGATIVE(r) (((r)->attributes & DNS_RDATASETATTR_NEGATIVE) != 0)
#define NXDOMAIN_RESULT(r) ((r) == DNS_R_NXDOMAIN || \
(r) == DNS_R_NCACHENXDOMAIN)
(r) == DNS_R_NCACHENXDOMAIN)
#define NXRRSET_RESULT(r) ((r) == DNS_R_NCACHENXRRSET || \
(r) == DNS_R_NXRRSET || \
(r) == DNS_R_HINTNXRRSET)
(r) == DNS_R_NXRRSET || \
(r) == DNS_R_HINTNXRRSET)
#ifdef ENABLE_AFL
bool dns_fuzzing_resolver = false;