]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3991] Fixed CWE 563 3 unreadVariable
authorFrancis Dupont <fdupont@isc.org>
Tue, 12 May 2026 09:55:03 +0000 (11:55 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 27 May 2026 20:03:02 +0000 (22:03 +0200)
src/lib/dhcp/tests/option6_auth_unittest.cc
src/lib/dns/labelsequence.cc

index 12b1d59d84a9a4e03c9952eef3ac30ac01e4ca34..95675b60cae39c33067cb76b6639191c96f1d60e 100644 (file)
@@ -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
index b6560aeb3dd210d6e33732689df5315df02e007c..bcf551c114a1d996e3f5645f6bbc49b0aaea2f48 100644 (file)
@@ -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