From: Francis Dupont Date: Tue, 12 May 2026 09:55:03 +0000 (+0200) Subject: [#3991] Fixed CWE 563 3 unreadVariable X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4674895b0dfd9705fa78f751505fb5526087b6fb;p=thirdparty%2Fkea.git [#3991] Fixed CWE 563 3 unreadVariable --- diff --git a/src/lib/dhcp/tests/option6_auth_unittest.cc b/src/lib/dhcp/tests/option6_auth_unittest.cc index 12b1d59d84..95675b60ca 100644 --- a/src/lib/dhcp/tests/option6_auth_unittest.cc +++ b/src/lib/dhcp/tests/option6_auth_unittest.cc @@ -158,9 +158,7 @@ TEST_F(Option6AuthTest, toText) { auth.reset(new Option6Auth(1,2,0,9000,{'a','b','c','d'})); string exp_txt = " protocol=1, algorithm=2, rdm method=0, rdm value=9000, value=61626364"; - - std::cout << auth->toText(2) << std::endl; - + EXPECT_EQ(exp_txt, auth->toText(2)); } } //end namespace diff --git a/src/lib/dns/labelsequence.cc b/src/lib/dns/labelsequence.cc index b6560aeb3d..bcf551c114 100644 --- a/src/lib/dns/labelsequence.cc +++ b/src/lib/dns/labelsequence.cc @@ -286,6 +286,7 @@ LabelSequence::toRawText(bool omit_final_dot) const { // use for integrity check unsigned int labels = getLabelCount(); // init with an impossible value to catch error cases in the end: + // cppcheck complains this value is never used... unsigned int count = Name::MAX_LABELLEN + 1; // result string: it will roughly have the same length as the wire format @@ -340,6 +341,7 @@ LabelSequence::toText(bool omit_final_dot) const { // use for integrity check unsigned int labels = getLabelCount(); // init with an impossible value to catch error cases in the end: + // cppcheck complains this value is never used... unsigned int count = Name::MAX_LABELLEN + 1; // result string: it will roughly have the same length as the wire format