aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendcache.c
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2015-12-09 13:07:35 +0100
committerNick Mathewson <nickm@torproject.org>2015-12-09 10:22:26 -0500
commitfbdd32ebe9021d34dbe314a9cb24480ff3a9c9b1 (patch)
tree0e469d79223de743f8b67ad73fea2d2deaf0c8d0 /src/or/rendcache.c
parent3dcb7320cf8cb458c60a5fe6d5d51dbaaf67f7f0 (diff)
downloadtor-fbdd32ebe9021d34dbe314a9cb24480ff3a9c9b1.tar.gz
tor-fbdd32ebe9021d34dbe314a9cb24480ff3a9c9b1.zip
Mention the expected length of the digests
Some functions that use digest maps did not mention that the digests are expected to have DIGEST_LEN bytes. This lead to buffer over-reads in the past.
Diffstat (limited to 'src/or/rendcache.c')
-rw-r--r--src/or/rendcache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/rendcache.c b/src/or/rendcache.c
index 790e0c246d..c69671e289 100644
--- a/src/or/rendcache.c
+++ b/src/or/rendcache.c
@@ -321,9 +321,9 @@ rend_cache_failure_purge(void)
}
/** Lookup the rend failure cache using a relay identity digest in
- * <b>identity</b> and service ID <b>service_id</b>. If found, the intro
- * failure is set in <b>intro_entry</b> else it stays untouched. Return 1
- * iff found else 0. */
+ * <b>identity</b> which has DIGEST_LEN bytes and service ID <b>service_id</b>
+ * which is a null-terminated string. If found, the intro failure is set in
+ * <b>intro_entry</b> else it stays untouched. Return 1 iff found else 0. */
STATIC int
cache_failure_intro_lookup(const uint8_t *identity, const char *service_id,
rend_cache_failure_intro_t **intro_entry)