[tor-commits] [tor/master] Use tor_memeq() instead of tor_memcmp() per code review

nickm at torproject.org nickm at torproject.org
Wed Oct 19 21:16:05 UTC 2016


commit 3b8a40f262b6aeecd52386e89096dc92d7455c1e
Author: Andrea Shepard <andrea at torproject.org>
Date:   Thu Oct 13 23:48:49 2016 +0000

    Use tor_memeq() instead of tor_memcmp() per code review
---
 src/or/entrynodes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 745dc24..e5b2492 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -2269,7 +2269,7 @@ is_node_used_as_guard_for_guard_selection(guard_selection_t *gs,
   tor_assert(node != NULL);
 
   SMARTLIST_FOREACH_BEGIN(gs->chosen_entry_guards, entry_guard_t *, e) {
-    if (tor_memcmp(e->identity, node->identity, DIGEST_LEN) == 0) {
+    if (tor_memeq(e->identity, node->identity, DIGEST_LEN)) {
       res = 1;
       break;
     }





More information about the tor-commits mailing list