commit 1ba193b7a8bb5d56aa58aad3a960cd454ad0d144 parent 8095c785f1929b379ab3341b42cbdb05c7598950 Author: George Kadianakis <desnacked@riseup.net> Date: Tue, 14 Jan 2020 12:21:29 +0200 Merge branch 'tor-github/pr/1656' Diffstat:
| M | src/feature/rend/rendcache.c | | | 9 | ++++++++- |
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/feature/rend/rendcache.c b/src/feature/rend/rendcache.c @@ -526,9 +526,16 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e) rend_cache_entry_t *entry = NULL; static const int default_version = 2; - tor_assert(rend_cache); tor_assert(query); + /* This is possible if we are in the shutdown process and the cache was + * freed while some other subsystem might do a lookup to the cache for + * cleanup reasons such HS circuit cleanup for instance. */ + if (!rend_cache) { + ret = -ENOENT; + goto end; + } + if (!rend_valid_v2_service_id(query)) { ret = -EINVAL; goto end;