aboutsummaryrefslogtreecommitdiff
path: root/src/or/microdesc.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-13 17:34:05 -0500
committerNick Mathewson <nickm@torproject.org>2012-12-13 17:34:05 -0500
commitb1ff8daeb521d1645bc35ffd7191599b7169c2bb (patch)
tree60c365a6cb8f67cb2abbf92cc7e504a282974713 /src/or/microdesc.c
parent579808d4cdc62346fffa364900d0d76cfa28b3e1 (diff)
downloadtor-b1ff8daeb521d1645bc35ffd7191599b7169c2bb.tar.gz
tor-b1ff8daeb521d1645bc35ffd7191599b7169c2bb.zip
Nuke uses of memcmp outside of unit tests
We want to be saying fast_mem{cmp,eq,neq} when we're doing a comparison that's allowed to exit early, or tor_mem{cmp,eq,neq} when we need a data-invariant timing. Direct use of memcmp tends to imply that we haven't thought about the issue.
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r--src/or/microdesc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index 7602a93457..788a7b1e16 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -479,7 +479,7 @@ microdesc_cache_rebuild(microdesc_cache_t *cache, int force)
if (PREDICT_UNLIKELY(
md->bodylen < 9 || fast_memneq(md->body, "onion-key", 9) != 0)) {
/* XXXX once bug 2022 is solved, we can kill this block and turn it
- * into just the tor_assert(!memcmp) */
+ * into just the tor_assert(fast_memeq) */
off_t avail = cache->cache_content->size - md->off;
char *bad_str;
tor_assert(avail >= 0);