Loading changes/ticket13036 0 → 100644 +5 −0 Original line number Diff line number Diff line o Minor bugfixes: - Fix a large number of false positive warnings from the clang analyzer static analysis tool. This should make real warnings easier for clang analyzer to find. Patch from "teor". Closes ticket 13036. src/common/address.c +2 −0 Original line number Diff line number Diff line Loading @@ -324,6 +324,8 @@ tor_addr_is_internal_(const tor_addr_t *addr, int for_listening, uint32_t iph4 = 0; uint32_t iph6[4]; sa_family_t v_family; tor_assert(addr); v_family = tor_addr_family(addr); if (v_family == AF_INET) { Loading src/or/circuitmux.c +7 −1 Original line number Diff line number Diff line Loading @@ -1092,8 +1092,11 @@ circuitmux_detach_circuit,(circuitmux_t *cmux, circuit_t *circ)) /* * Use this to keep track of whether we found it for n_chan or * p_chan for consistency checking. * * The 0 initializer is not a valid cell_direction_t value. * We assert that it has been replaced with a valid value before it is used. */ cell_direction_t last_searched_direction; cell_direction_t last_searched_direction = 0; tor_assert(cmux); tor_assert(cmux->chanid_circid_map); Loading Loading @@ -1123,6 +1126,9 @@ circuitmux_detach_circuit,(circuitmux_t *cmux, circuit_t *circ)) } } tor_assert(last_searched_direction == CELL_DIRECTION_OUT || last_searched_direction == CELL_DIRECTION_IN); /* * If hashent isn't NULL, we have a circuit to detach; don't remove it from * the map until later of circuitmux_make_circuit_inactive() breaks. Loading src/or/connection.c +1 −0 Original line number Diff line number Diff line Loading @@ -1613,6 +1613,7 @@ connection_connect(connection_t *conn, const char *address, } } tor_assert(options); if (options->ConstrainedSockets) set_constrained_socket_buffers(s, (int)options->ConstrainedSockSize); Loading src/or/control.c +3 −2 Original line number Diff line number Diff line Loading @@ -2639,7 +2639,7 @@ handle_control_attachstream(control_connection_t *conn, uint32_t len, /* Is this a single hop circuit? */ if (circ && (circuit_get_cpath_len(circ)<2 || hop==1)) { const node_t *node = NULL; char *exit_digest; char *exit_digest = NULL; if (circ->build_state && circ->build_state->chosen_exit && !tor_digest_is_zero(circ->build_state->chosen_exit->identity_digest)) { Loading @@ -2654,6 +2654,7 @@ handle_control_attachstream(control_connection_t *conn, uint32_t len, "551 Can't attach stream to this one-hop circuit.\r\n", conn); return 0; } tor_assert(exit_digest); ap_conn->chosen_exit_name = tor_strdup(hex_str(exit_digest, DIGEST_LEN)); } Loading Loading @@ -4921,7 +4922,7 @@ MOCK_IMPL(void, or_connection_t *or_conn)) { int status = bootstrap_percent; const char *tag, *summary; const char *tag = "", *summary = ""; char buf[BOOTSTRAP_MSG_LEN]; const char *recommendation = "ignore"; int severity; Loading Loading
changes/ticket13036 0 → 100644 +5 −0 Original line number Diff line number Diff line o Minor bugfixes: - Fix a large number of false positive warnings from the clang analyzer static analysis tool. This should make real warnings easier for clang analyzer to find. Patch from "teor". Closes ticket 13036.
src/common/address.c +2 −0 Original line number Diff line number Diff line Loading @@ -324,6 +324,8 @@ tor_addr_is_internal_(const tor_addr_t *addr, int for_listening, uint32_t iph4 = 0; uint32_t iph6[4]; sa_family_t v_family; tor_assert(addr); v_family = tor_addr_family(addr); if (v_family == AF_INET) { Loading
src/or/circuitmux.c +7 −1 Original line number Diff line number Diff line Loading @@ -1092,8 +1092,11 @@ circuitmux_detach_circuit,(circuitmux_t *cmux, circuit_t *circ)) /* * Use this to keep track of whether we found it for n_chan or * p_chan for consistency checking. * * The 0 initializer is not a valid cell_direction_t value. * We assert that it has been replaced with a valid value before it is used. */ cell_direction_t last_searched_direction; cell_direction_t last_searched_direction = 0; tor_assert(cmux); tor_assert(cmux->chanid_circid_map); Loading Loading @@ -1123,6 +1126,9 @@ circuitmux_detach_circuit,(circuitmux_t *cmux, circuit_t *circ)) } } tor_assert(last_searched_direction == CELL_DIRECTION_OUT || last_searched_direction == CELL_DIRECTION_IN); /* * If hashent isn't NULL, we have a circuit to detach; don't remove it from * the map until later of circuitmux_make_circuit_inactive() breaks. Loading
src/or/connection.c +1 −0 Original line number Diff line number Diff line Loading @@ -1613,6 +1613,7 @@ connection_connect(connection_t *conn, const char *address, } } tor_assert(options); if (options->ConstrainedSockets) set_constrained_socket_buffers(s, (int)options->ConstrainedSockSize); Loading
src/or/control.c +3 −2 Original line number Diff line number Diff line Loading @@ -2639,7 +2639,7 @@ handle_control_attachstream(control_connection_t *conn, uint32_t len, /* Is this a single hop circuit? */ if (circ && (circuit_get_cpath_len(circ)<2 || hop==1)) { const node_t *node = NULL; char *exit_digest; char *exit_digest = NULL; if (circ->build_state && circ->build_state->chosen_exit && !tor_digest_is_zero(circ->build_state->chosen_exit->identity_digest)) { Loading @@ -2654,6 +2654,7 @@ handle_control_attachstream(control_connection_t *conn, uint32_t len, "551 Can't attach stream to this one-hop circuit.\r\n", conn); return 0; } tor_assert(exit_digest); ap_conn->chosen_exit_name = tor_strdup(hex_str(exit_digest, DIGEST_LEN)); } Loading Loading @@ -4921,7 +4922,7 @@ MOCK_IMPL(void, or_connection_t *or_conn)) { int status = bootstrap_percent; const char *tag, *summary; const char *tag = "", *summary = ""; char buf[BOOTSTRAP_MSG_LEN]; const char *recommendation = "ignore"; int severity; Loading