aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-09-02 11:55:53 -0400
committerNick Mathewson <nickm@torproject.org>2014-09-02 11:56:56 -0400
commitefcab439564dcadc5bc14609a9205d73d236e966 (patch)
tree32b90aeed52b5d76bb862bd824b16bf0e2c7829a /src/or/control.c
parent8139db372528ca02cd572f3f7848e9d174a9b12e (diff)
downloadtor-efcab439564dcadc5bc14609a9205d73d236e966.tar.gz
tor-efcab439564dcadc5bc14609a9205d73d236e966.zip
Fix a number of clang analyzer false-positives
Most of these are in somewhat non-obvious code where it is probably a good idea to initialize variables and add extra assertions anyway. Closes 13036. Patches from "teor".
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c
index ec63506194..4a6b18d02a 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -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)) {
@@ -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));
}
@@ -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;