From 1b6f6bfda59989389983602c57ef0028dd736908 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 27 Mar 2012 15:00:34 +0200 Subject: [PATCH 1/2] Don't try to generate stats from an empty served_descs. --- src/or/rephist.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/or/rephist.c b/src/or/rephist.c index 3d5000ccf8..0cd60eeb83 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -2657,6 +2657,8 @@ rep_hist_format_desc_stats(time_t now) return NULL; size = digestmap_size(served_descs); + if (size == 0) + return NULL; vals = tor_malloc(size * sizeof(int)); for (iter = digestmap_iter_init(served_descs); !digestmap_iter_done(iter); From d2cf90dc8886aafc1ea16220324473697682c94f Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Tue, 27 Mar 2012 15:00:34 +0200 Subject: [PATCH 2/2] Add changes file. --- changes/bug5508 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changes/bug5508 diff --git a/changes/bug5508 b/changes/bug5508 new file mode 100644 index 0000000000..6606f822f2 --- /dev/null +++ b/changes/bug5508 @@ -0,0 +1,4 @@ + o Minor bugfixes: + - Fix a bug where a bridge authority crashes (on a failed assert) + if it has seen no directory requests when it's time to write + statistics to disk.