diff options
author | Donncha O'Cearbhaill <donncha@donncha.is> | 2015-08-24 15:17:33 +0200 |
---|---|---|
committer | Donncha O'Cearbhaill <donncha@donncha.is> | 2015-09-08 12:34:05 +0200 |
commit | ee1a4ce8b2d927dff5e8feafe8b0363d57a4f32e (patch) | |
tree | 2c8b4629030cf87e62ce069cdb845f41a1034d6f /src/or/rendcache.c | |
parent | 293410d1384742fe0da2f760707e3a282f4056b2 (diff) | |
download | tor-ee1a4ce8b2d927dff5e8feafe8b0363d57a4f32e.tar.gz tor-ee1a4ce8b2d927dff5e8feafe8b0363d57a4f32e.zip |
Require explict specification of cache type
Diffstat (limited to 'src/or/rendcache.c')
-rw-r--r-- | src/or/rendcache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/rendcache.c b/src/or/rendcache.c index 7617e9db28..aae37ebbf7 100644 --- a/src/or/rendcache.c +++ b/src/or/rendcache.c @@ -491,6 +491,7 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e, tor_assert(rend_cache_service); tor_assert(rend_cache); tor_assert(query); + tor_assert(cache); if (!rend_valid_service_id(query)) { ret = -EINVAL; @@ -506,7 +507,7 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e, default: if(cache == REND_CACHE_TYPE_SERVICE){ entry = strmap_get_lc(rend_cache_service, query); - } else { + } else if (cache == REND_CACHE_TYPE_CLIENT) { tor_snprintf(key, sizeof(key), "%d%s", default_version, query); entry = strmap_get_lc(rend_cache, key); } |