--- /dev/null
+ 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.
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) {
/*
* 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);
}
}
+ 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.
}
}
+ tor_assert(options);
if (options->ConstrainedSockets)
set_constrained_socket_buffers(s, (int)options->ConstrainedSockSize);
/* 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)) {
"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));
}
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;
compare_vote_rs(const vote_routerstatus_t *a, const vote_routerstatus_t *b)
{
int r;
+ tor_assert(a);
+ tor_assert(b);
+
if ((r = fast_memcmp(a->status.identity_digest, b->status.identity_digest,
DIGEST_LEN)))
return r;
const tor_addr_port_t *most_alt_orport = NULL;
SMARTLIST_FOREACH_BEGIN(votes, vote_routerstatus_t *, rs) {
+ tor_assert(rs);
if (compare_vote_rs(most, rs) == 0 &&
!tor_addr_is_null(&rs->status.ipv6_addr)
&& rs->status.ipv6_orport) {
time_t start;
uint64_t v, mv;
- int i,ok,ok_m;
+ int i,ok,ok_m = 0;
int have_maxima = s_maxima && s_values &&
(smartlist_len(s_values) == smartlist_len(s_maxima));
{
routerinfo_t *router;
extrainfo_t *extrainfo;
- signed_descriptor_t *signed_desc;
+ signed_descriptor_t *signed_desc = NULL;
void *elt;
const char *end, *start;
int have_extrainfo;
continue;
}
if (saved_location != SAVED_NOWHERE) {
+ tor_assert(signed_desc);
signed_desc->saved_location = saved_location;
signed_desc->saved_offset = *s - start;
}