diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-06-30 15:34:16 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-06-30 15:34:16 -0400 |
commit | b750a77e3fc16cc670d89be1d1ed4d278d4ca989 (patch) | |
tree | 9ca285f67cbd1f7b4a339ee04268a8f56600b7c4 /src/or/routerparse.c | |
parent | 2713de2a47f652f1d0637df7b9b02b6ec039a8f6 (diff) | |
download | tor-b750a77e3fc16cc670d89be1d1ed4d278d4ca989.tar.gz tor-b750a77e3fc16cc670d89be1d1ed4d278d4ca989.zip |
fix naked memcmps
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 13ffaf9511..63397b5bce 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -773,7 +773,7 @@ dump_desc_fifo_bump_hash(const uint8_t *digest_sha256) /* Find a match if one exists */ SMARTLIST_FOREACH_BEGIN(descs_dumped, dumped_desc_t *, ent) { if (ent && - memcmp(ent->digest_sha256, digest_sha256, DIGEST256_LEN) == 0) { + tor_memeq(ent->digest_sha256, digest_sha256, DIGEST256_LEN)) { /* * Save a pointer to the match and remove it from its current * position. @@ -919,7 +919,7 @@ dump_desc_populate_one_file, (const char *dirname, const char *f)) } /* Compare the digests */ - if (memcmp(digest, content_digest, DIGEST256_LEN) != 0) { + if (tor_memneq(digest, content_digest, DIGEST256_LEN)) { /* No match */ log_info(LD_DIR, "Hash of %s from unparseable descriptors directory didn't " |