aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendcommon.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-11 16:39:45 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-11 16:39:45 -0400
commit9fba014e3f7f89520841b65b8b038e5fb931b1d6 (patch)
tree2197904844e7ae25b4a2d6465c2aa0cca1798019 /src/or/rendcommon.c
parent6d5478a8a7734553fc84574e725625610f46dc8c (diff)
parent8fb38331c3213caef2d2e003e02cdb361504f14f (diff)
downloadtor-9fba014e3f7f89520841b65b8b038e5fb931b1d6.tar
tor-9fba014e3f7f89520841b65b8b038e5fb931b1d6.tar.gz
Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023
Conflicts in various places, mainly node-related. Resolved them in favor of HEAD, with copying of tor_mem* operations from bug3122_memcmp_022. src/common/Makefile.am src/or/circuitlist.c src/or/connection_edge.c src/or/directory.c src/or/microdesc.c src/or/networkstatus.c src/or/router.c src/or/routerlist.c src/test/test_util.c
Diffstat (limited to 'src/or/rendcommon.c')
-rw-r--r--src/or/rendcommon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 3ee7419d7..45044324a 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -884,15 +884,15 @@ rend_id_is_in_interval(const char *a, const char *b, const char *c)
tor_assert(c);
/* There are five cases in which a is outside the interval ]b,c]: */
- a_b = memcmp(a,b,DIGEST_LEN);
+ a_b = tor_memcmp(a,b,DIGEST_LEN);
if (a_b == 0)
return 0; /* 1. a == b (b is excluded) */
- b_c = memcmp(b,c,DIGEST_LEN);
+ b_c = tor_memcmp(b,c,DIGEST_LEN);
if (b_c == 0)
return 0; /* 2. b == c (interval is empty) */
else if (a_b <= 0 && b_c < 0)
return 0; /* 3. a b c */
- c_a = memcmp(c,a,DIGEST_LEN);
+ c_a = tor_memcmp(c,a,DIGEST_LEN);
if (c_a < 0 && a_b <= 0)
return 0; /* 4. c a b */
else if (b_c < 0 && c_a < 0)
@@ -1066,7 +1066,7 @@ rend_cache_store(const char *desc, size_t desc_len, int published)
rend_service_descriptor_free(parsed);
return 0;
}
- if (e && e->len == desc_len && !memcmp(desc,e->desc,desc_len)) {
+ if (e && e->len == desc_len && tor_memeq(desc,e->desc,desc_len)) {
log_info(LD_REND,"We already have this service descriptor %s.",
safe_str_client(query));
e->received = time(NULL);