summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-02-23 23:11:08 +0000
committerNick Mathewson <nickm@torproject.org>2007-02-23 23:11:08 +0000
commit4e05ccb289aaf5b8afc24888dedd4bd9bda285ef (patch)
tree5695c597326ae70d44c3a2c63a9aa8d3ea9ce16e
parentddc34f603743eea018346a4ada73b43e8de247a8 (diff)
downloadtor-4e05ccb289aaf5b8afc24888dedd4bd9bda285ef.tar.gz
tor-4e05ccb289aaf5b8afc24888dedd4bd9bda285ef.zip
r11900@catbus: nickm | 2007-02-23 18:11:04 -0500
Fix null-pointer access on update_router_descriptor_cache_downloads. svn:r9626
-rw-r--r--src/or/routerlist.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index f11f1670ea..e9ac4534e3 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4029,13 +4029,12 @@ update_router_descriptor_cache_downloads(time_t now)
SMARTLIST_FOREACH(networkstatus_list, networkstatus_t *, ns,
{
smartlist_t *dl;
+ dl = downloadable[ns_sl_idx] = smartlist_create();
+ download_from[ns_sl_idx] = smartlist_create();
if (ns->published_on + MAX_NETWORKSTATUS_AGE-10*60 > now) {
/* Don't download if the networkstatus is almost ancient. */
continue;
}
- dl = smartlist_create();
- downloadable[ns_sl_idx] = dl;
- download_from[ns_sl_idx] = smartlist_create();
SMARTLIST_FOREACH(ns->entries, routerstatus_t * , rs,
{
if (!rs->need_to_mirror)
@@ -4076,7 +4075,6 @@ update_router_descriptor_cache_downloads(time_t now)
smartlist_t *dl = downloadable[which_ns];
int idx;
char *d;
- tor_assert(dl);
if (!smartlist_len(dl))
continue;
idx = crypto_rand_int(smartlist_len(dl));