BIND 10 #3312: Fix new cppcheck reports

BIND 10 Development do-not-reply at isc.org
Wed Jan 29 14:58:38 UTC 2014


#3312: Fix new cppcheck reports
-------------------------------------+-------------------------------------
                   Reporter:  muks   |                 Owner:
                       Type:         |                Status:  new
  defect                             |             Milestone:  bind10-1.2
                   Priority:         |  -release-freeze
  medium                             |              Keywords:
                  Component:         |             Sensitive:  0
  Unclassified                       |           Sub-Project:  DNS
               CVSS Scoring:         |  Estimated Difficulty:  0
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
 These are reports from Cppcheck 1.63:
 {{{
 src/bin/d2/tests/nc_trans_unittests.cc:329: check_fail: The scope of the
 variable 'cnt' can be reduced. (style,variableScope)
 src/lib/dhcp/iface_mgr.h:1025: check_fail: Function parameter 'addr'
 should be passed by reference. (performance,passedByValue)
 src/bin/dhcp4/tests/config_parser_unittest.cc:194: check_fail: Unmatched
 suppression: unreadVariable (information,unmatchedSuppression)
 src/bin/dhcp6/tests/config_parser_unittest.cc:207: check_fail: Unmatched
 suppression: unreadVariable (information,unmatchedSuppression)
 src/lib/acl/ip_check.cc:131: check_fail: Uninitialized variable: data_ptr
 (error,uninitvar)
 src/lib/datasrc/memory/zone_data_loader.cc:72: check_fail: Function
 parameter 'rrclass' should be passed by reference.
 (performance,passedByValue)
 src/lib/datasrc/tests/database_unittest.cc:1686: check_fail: Function
 parameter 'expected_ttl' should be passed by reference.
 (performance,passedByValue)
 src/lib/datasrc/tests/database_unittest.cc:1740: check_fail: Function
 parameter 'expected_ttl' should be passed by reference.
 (performance,passedByValue)
 src/lib/datasrc/tests/database_unittest.cc:1761: check_fail: Function
 parameter 'expected_ttl' should be passed by reference.
 (performance,passedByValue)
 src/lib/datasrc/tests/database_unittest.cc:1784: check_fail: Function
 parameter 'expected_type' should be passed by reference.
 (performance,passedByValue)
 src/lib/dhcp/iface_mgr_bsd.cc:155: check_fail: Function parameter 'addr'
 should be passed by reference. (performance,passedByValue)
 src/lib/dhcp/iface_mgr_linux.cc:539: check_fail: Function parameter 'addr'
 should be passed by reference. (performance,passedByValue)
 src/lib/dhcp/iface_mgr_sun.cc:159: check_fail: Function parameter 'addr'
 should be passed by reference. (performance,passedByValue)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:410: check_fail: Array
 'leases[2]' accessed at index 2, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:412: check_fail: Array
 'leases[2]' accessed at index 2, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:414: check_fail: Array
 'leases[2]' accessed at index 2, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:440: check_fail: Array
 'leases[2]' accessed at index 2, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:572: check_fail: Array
 'leases[1]' accessed at index 2, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:574: check_fail: Array
 'leases[1]' accessed at index 2, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:577: check_fail: Array
 'leases[1]' accessed at index 7, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:579: check_fail: Array
 'leases[1]' accessed at index 7, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:581: check_fail: Array
 'leases[1]' accessed at index 7, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc:744: check_fail: Array
 'leases[7]' accessed at index 7, which is out of bounds.
 (error,arrayIndexOutOfBounds)
 src/lib/dns/python/rdata_python.cc:107: check_fail: The scope of the
 variable 'self' can be reduced. (style,variableScope)
 src/lib/dns/python/rrset_python.cc:254: check_fail: The scope of the
 variable 'self' can be reduced. (style,variableScope)
 src/lib/log/message_dictionary.cc:68: check_fail: The scope of the
 variable 'ident' can be reduced. (style,variableScope)
 src/lib/resolve/tests/recursive_query_unittest.cc:409: check_fail: The
 class 'MockServerStop' defines member variable with name 'done_' also
 defined in its parent class 'MockServer'. (warning,duplInheritedMember)
 }}}

 It would be good to address these before branching for the release.

-- 
Ticket URL: <http://bind10.isc.org/ticket/3312>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list