summaryrefslogtreecommitdiff
path: root/src/or/hs_cache.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2018-01-31 10:58:11 -0500
committerNick Mathewson <nickm@torproject.org>2018-01-31 12:51:42 -0500
commitdf312b3cf637d2c5487adc60ed541823bef56f06 (patch)
tree3ac5df833b0eee727ca033b2338164f257f0c18e /src/or/hs_cache.c
parent9bfb6fe3958240172f1133e918d1fc6bd5732532 (diff)
downloadtor-df312b3cf637d2c5487adc60ed541823bef56f06.tar.gz
tor-df312b3cf637d2c5487adc60ed541823bef56f06.zip
hs-v3: Remove a BUG() when storing a descriptor in the client cache
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>
Diffstat (limited to 'src/or/hs_cache.c')
-rw-r--r--src/or/hs_cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/hs_cache.c b/src/or/hs_cache.c
index 3ebe13fb4d..6a5a3895b0 100644
--- a/src/or/hs_cache.c
+++ b/src/or/hs_cache.c
@@ -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;
}