From: Remi Gacogne Date: Wed, 24 Nov 2021 14:20:55 +0000 (+0100) Subject: dnsdist: Fix g++/LTO warning about uninitialized dnsheaders in the unit test X-Git-Tag: dnsdist-1.7.0-beta2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11031%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Fix g++/LTO warning about uninitialized dnsheaders in the unit test --- diff --git a/pdns/dnsdistdist/test-dnsdistdynblocks_hh.cc b/pdns/dnsdistdist/test-dnsdistdynblocks_hh.cc index 58593ccbe5..61b5ffb3ec 100644 --- a/pdns/dnsdistdist/test-dnsdistdynblocks_hh.cc +++ b/pdns/dnsdistdist/test-dnsdistdynblocks_hh.cc @@ -447,6 +447,7 @@ BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_QueryRate_responses) { BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_QTypeRate) { dnsheader dh; + memset(&dh, 0, sizeof(dh)); DNSName qname("rings.powerdns.com."); ComboAddress requestor1("192.0.2.1"); ComboAddress requestor2("192.0.2.2"); @@ -534,6 +535,7 @@ BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_QTypeRate) { BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_RCodeRate) { dnsheader dh; + memset(&dh, 0, sizeof(dh)); DNSName qname("rings.powerdns.com."); ComboAddress requestor1("192.0.2.1"); ComboAddress requestor2("192.0.2.2"); @@ -626,6 +628,7 @@ BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_RCodeRate) { BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_RCodeRatio) { dnsheader dh; + memset(&dh, 0, sizeof(dh)); DNSName qname("rings.powerdns.com."); ComboAddress requestor1("192.0.2.1"); ComboAddress requestor2("192.0.2.2"); @@ -744,6 +747,7 @@ BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_RCodeRatio) { BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_ResponseByteRate) { dnsheader dh; + memset(&dh, 0, sizeof(dh)); DNSName qname("rings.powerdns.com."); ComboAddress requestor1("192.0.2.1"); ComboAddress requestor2("192.0.2.2"); @@ -817,6 +821,7 @@ BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_ResponseByteRate) { BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_Warning) { dnsheader dh; + memset(&dh, 0, sizeof(dh)); DNSName qname("rings.powerdns.com."); ComboAddress requestor1("192.0.2.1"); ComboAddress requestor2("192.0.2.2"); @@ -976,6 +981,7 @@ BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_Warning) { BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_Ranges) { dnsheader dh; + memset(&dh, 0, sizeof(dh)); DNSName qname("rings.powerdns.com."); ComboAddress requestor1("192.0.2.1"); ComboAddress requestor2("192.0.2.42");