summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/bug55084
-rw-r--r--src/or/rephist.c2
2 files changed, 6 insertions, 0 deletions
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.
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);