]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs-v3: Remove a BUG() when storing a descriptor in the client cache
authorDavid Goulet <dgoulet@torproject.org>
Wed, 31 Jan 2018 15:58:11 +0000 (10:58 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 31 Jan 2018 17:51:42 +0000 (12:51 -0500)
It is possible in normal circumstances that  a client fetches a descriptor
that has a lower revision counter than the one in its cache. This can happen
due to HSDir desync.

Fixes #24976

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/bug24976 [new file with mode: 0644]
src/or/hs_cache.c

diff --git a/changes/bug24976 b/changes/bug24976
new file mode 100644 (file)
index 0000000..9c3be86
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (hidden service v3 client):
+    - Remove a BUG() statement which can be triggered in normal circumstances
+      where a client fetches a descriptor that has a lower revision counter
+      than the one in its cache. This can happen due to HSDir desync. Fixes
+      bug 24976; bugfix on 0.3.2.1-alpha.
index 3ebe13fb4dbc83fa96b00319dc8aef0832a6d9d0..6a5a3895b0107ee1dc3155e769485c68dc2102d8 100644 (file)
@@ -624,8 +624,8 @@ cache_store_as_client(hs_cache_client_descriptor_t *client_desc)
   if (cache_entry != NULL) {
     /* If we have an entry in our cache that has a revision counter greater
      * than the one we just fetched, discard the one we fetched. */
-    if (BUG(cache_entry->desc->plaintext_data.revision_counter >
-            client_desc->desc->plaintext_data.revision_counter)) {
+    if (cache_entry->desc->plaintext_data.revision_counter >
+        client_desc->desc->plaintext_data.revision_counter) {
       cache_client_desc_free(client_desc);
       goto done;
     }