]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add missing code to set cache->journal_len when reading microdesc journal
authorNick Mathewson <nickm@torproject.org>
Tue, 3 May 2011 20:22:31 +0000 (16:22 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 3 May 2011 20:22:31 +0000 (16:22 -0400)
This could be one reason that authorities' journals would grow without
bound; related to bug 2230. Bugfix on 0.2.2.6-alpha.  Fix by
"cypherpunks".

changes/bug2230_part1 [new file with mode: 0644]
src/or/microdesc.c

diff --git a/changes/bug2230_part1 b/changes/bug2230_part1
new file mode 100644 (file)
index 0000000..79f7254
--- /dev/null
@@ -0,0 +1,7 @@
+  o Minor bugfixes
+    - When loading the microdesc journal, remember its current size.
+      In 0.2.2, this helps prevent the microdesc journal from growing
+      without limit on authorities (who are the only ones to use it in
+      0.2.2).  Fixes a part of bug 2230; bugfix on 0.2.2.6-alpha.
+      Fix posted by "cypherpunks."
+      
index 2c4b3435f77930141d7cbd576ca46f2b5a4739a0..356627700d2f811f67d57edacb24546b95748051 100644 (file)
@@ -261,6 +261,7 @@ microdesc_cache_reload(microdesc_cache_t *cache)
   journal_content = read_file_to_str(cache->journal_fname,
                                      RFTS_IGNORE_MISSING, &st);
   if (journal_content) {
+    cache->journal_len = (size_t) st.st_size;
     added = microdescs_add_to_cache(cache, journal_content,
                                     journal_content+st.st_size,
                                     SAVED_IN_JOURNAL, 0);