diff options
author | Roger Dingledine <arma@torproject.org> | 2007-05-20 14:15:23 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-05-20 14:15:23 +0000 |
commit | ddd0054a8504f274e3cf16d6728b8b052e0c8a49 (patch) | |
tree | 10316521a4602884e10f3c176b77cc328362da0a | |
parent | 0b661f65759408af19fbd30587deffc0bc3163d8 (diff) | |
download | tor-ddd0054a8504f274e3cf16d6728b8b052e0c8a49.tar.gz tor-ddd0054a8504f274e3cf16d6728b8b052e0c8a49.zip |
point out two remote crash bugs, a memory leak, and a few other
items we should probably look into.
svn:r10227
-rw-r--r-- | src/common/mempool.c | 2 | ||||
-rw-r--r-- | src/or/config.c | 2 | ||||
-rw-r--r-- | src/or/dns.c | 4 | ||||
-rw-r--r-- | src/or/main.c | 2 | ||||
-rw-r--r-- | src/or/routerlist.c | 2 | ||||
-rw-r--r-- | src/or/routerparse.c | 3 |
6 files changed, 12 insertions, 3 deletions
diff --git a/src/common/mempool.c b/src/common/mempool.c index feb32230b1..173c6034da 100644 --- a/src/common/mempool.c +++ b/src/common/mempool.c @@ -388,6 +388,8 @@ mp_pool_clean(mp_pool_t *pool, int n) n = pool->min_empty_chunks + (-n); if (n < pool->n_empty_chunks) pool->min_empty_chunks = n; + /* XXX020 don't we want some sort of return here, given the + * assert that follows? -RD */ } ASSERT(n>=0); diff --git a/src/or/config.c b/src/or/config.c index bed3ff9ad2..0e3cffae82 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -3119,6 +3119,8 @@ options_init_from_torrc(int argc, char **argv) if (argc > 1 && (!strcmp(argv[1],"--version"))) { char vbuf[128]; + // XXX020 below, tor_svn_revision will always be defined, right? + // So we can take out that check? Also in router.c. -RD if (tor_svn_revision != NULL && strlen(tor_svn_revision)) { tor_snprintf(vbuf, sizeof(vbuf), " (r%s)", tor_svn_revision); } else { diff --git a/src/or/dns.c b/src/or/dns.c index 665e0820b7..7bd8c7a884 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -559,8 +559,10 @@ dns_resolve(edge_connection_t *exitconn) } //circuit_detach_stream(TO_CIRCUIT(oncirc), exitconn); exitconn->on_circuit = NULL; - if (!exitconn->_base.marked_for_close) + if (!exitconn->_base.marked_for_close) { connection_free(TO_CONN(exitconn)); + //XXX020 ... and we just leak exitconn otherwise? -RD + } break; default: tor_assert(0); diff --git a/src/or/main.c b/src/or/main.c index 4749df65dd..f0522f6fa4 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -68,7 +68,7 @@ static time_t time_of_last_signewnym = 0; static int signewnym_is_pending = 0; /** Array of all open connections. The first n_conns elements are valid. */ -/*XXXX020 Should we just use a smartlist here? */ +/*XXXX020 Should we just use a smartlist here? -NM Sure. -RD */ static connection_t *connection_array[MAXCONNECTIONS+1] = { NULL }; /** List of connections that have been marked for close and need to be freed diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 2aab834df4..82117f0d2c 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -4857,6 +4857,8 @@ routerinfo_incompatible_with_extrainfo(routerinfo_t *ri, extrainfo_t *ei) if (ei->bad_sig) return 1; + /* XXX020 below we should explain why this is strcmp and not strcasecmp, + * since it differs from how we usually compare nicknames. -RD */ if (strcmp(ri->nickname, ei->nickname) || memcmp(ri->cache_info.identity_digest, ei->cache_info.identity_digest, DIGEST_LEN)) diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 67de895e37..2d363030de 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -2142,7 +2142,8 @@ tokenize_string(const char *start, const char *end, smartlist_t *out, for (i = 0; table[i].t; ++i) { if (counts[table[i].v] < table[i].min_cnt) { log_warn(LD_DIR, "Parse error: missing %s element.", table[i].t); - tor_assert(0); + tor_assert(0); /* XXX020 is this assert a remote crash waiting to + * happen? -RD */ return -1; } if (counts[table[i].v] > table[i].max_cnt) { |