From efe11d43838e2f399aef16b167b343f312f0ad73 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Thu, 18 Feb 2021 14:49:23 +0100 Subject: [PATCH 1/3] Initialize checknames field in query_test.c 'checknames' field of struct dns_view is not initialized by dns_view_create(). ASAN identified this as runtime error: runtime error: load of value 190, which is not a valid value for type '_Bool' --- lib/ns/tests/query_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ns/tests/query_test.c b/lib/ns/tests/query_test.c index 6630ee3369..6558d3c981 100644 --- a/lib/ns/tests/query_test.c +++ b/lib/ns/tests/query_test.c @@ -1412,6 +1412,7 @@ run_hookasync_e2e_test(const ns__query_hookasync_e2e_test_params_t *test) { qctx->client->sendcb = send_noop; /* Load a zone. it should have ns.foo/A */ + qctx->client->view->checknames = true; result = ns_test_serve_zone("foo", "testdata/query/foo.db", qctx->client->view); INSIST(result == ISC_R_SUCCESS); From 40b6db58a1fe8401def1dfc35987d6b0c433616b Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Mon, 22 Feb 2021 13:40:31 +0100 Subject: [PATCH 2/3] Revert "Initialize checknames field in query_test.c" This reverts commit c75484c4dff04698c183b456a6cc85f951264e75. --- lib/ns/tests/query_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ns/tests/query_test.c b/lib/ns/tests/query_test.c index 6558d3c981..6630ee3369 100644 --- a/lib/ns/tests/query_test.c +++ b/lib/ns/tests/query_test.c @@ -1412,7 +1412,6 @@ run_hookasync_e2e_test(const ns__query_hookasync_e2e_test_params_t *test) { qctx->client->sendcb = send_noop; /* Load a zone. it should have ns.foo/A */ - qctx->client->view->checknames = true; result = ns_test_serve_zone("foo", "testdata/query/foo.db", qctx->client->view); INSIST(result == ISC_R_SUCCESS); From 0c6fa16477075ef0bcac46c9952ac771740e56d7 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Mon, 22 Feb 2021 13:50:11 +0100 Subject: [PATCH 3/3] Initialize checknames field in dns_view_create() The 'checknames' field wasn't initialized in dns_view_create(), but it should otherwise AddressSanitizer identifies the following runtime error in query_test.c. runtime error: load of value 190, which is not a valid value for type '_Bool' --- lib/dns/view.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dns/view.c b/lib/dns/view.c index ae662f850e..2c5662473e 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -190,6 +190,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, const char *name, view->transfer_format = dns_one_answer; view->cacheacl = NULL; view->cacheonacl = NULL; + view->checknames = false; view->queryacl = NULL; view->queryonacl = NULL; view->recursionacl = NULL;