aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/connection_edge.c1
-rw-r--r--src/or/control.c2
-rw-r--r--src/or/dirvote.c2
-rw-r--r--src/or/eventdns.c1
-rw-r--r--src/or/routerlist.c5
5 files changed, 5 insertions, 6 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 54c6f87d71..c42e8ca4f5 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -2304,6 +2304,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
address = tor_strdup(or_circ->p_conn->_base.address);
else
address = tor_strdup("127.0.0.1");
+ port = 1; /*XXXX020 set this to something sensible? - NM*/
} else {
log_warn(LD_BUG, "Got an unexpected command %d", (int)rh.command);
end_payload[0] = END_STREAM_REASON_INTERNAL;
diff --git a/src/or/control.c b/src/or/control.c
index d216339b30..d6424d8581 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -2325,7 +2325,7 @@ handle_control_redirectstream(control_connection_t *conn, uint32_t len,
connection_printf_to_buf(conn, "552 Unknown stream \"%s\"\r\n",
(char*)smartlist_get(args, 0));
} else {
- int ok;
+ int ok = 1;
if (smartlist_len(args) > 2) { /* they included a port too */
new_port = (uint16_t) tor_parse_ulong(smartlist_get(args, 2),
10, 1, 65535, &ok, NULL);
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index a4b7492739..328e05aa8a 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -82,7 +82,7 @@ format_networkstatus_vote(crypto_pk_env_t *private_signing_key,
char *cp;
if (client_versions)
v_len += strlen(client_versions);
- if (client_versions)
+ if (server_versions)
v_len += strlen(server_versions);
version_lines = tor_malloc(v_len);
cp = version_lines;
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index d923d26cc1..f6dbe03018 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -2118,6 +2118,7 @@ _evdns_nameserver_add_impl(unsigned long int address, int port) {
#else
fcntl(ns->socket, F_SETFL, O_NONBLOCK);
#endif
+ memset(&sin, 0, sizeof(sin));
sin.sin_addr.s_addr = address;
sin.sin_port = htons(port);
sin.sin_family = AF_INET;
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index e789322b33..1c48c762a4 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -492,7 +492,6 @@ _compare_signed_descriptors_by_age(const void **_a, const void **_b)
static int
router_rebuild_store(int force, desc_store_t *store)
{
- or_options_t *options;
smartlist_t *chunk_list = NULL;
char *fname = NULL, *fname_tmp = NULL;
int r = -1;
@@ -518,8 +517,6 @@ router_rebuild_store(int force, desc_store_t *store)
log_info(LD_DIR, "Rebuilding %s cache", store->description);
- options = get_options();
-
fname = get_datadir_fname(store->fname_base);
fname_tmp = get_datadir_fname_suffix(store->fname_base, ".tmp");
@@ -1903,7 +1900,7 @@ router_get_by_hexdigest(const char *hexdigest)
ri = router_get_by_digest(digest);
- if (len > HEX_DIGEST_LEN) {
+ if (ri && len > HEX_DIGEST_LEN) {
if (hexdigest[HEX_DIGEST_LEN] == '=') {
if (strcasecmp(ri->nickname, hexdigest+HEX_DIGEST_LEN+1) ||
!ri->is_named)