diff options
author | George Kadianakis <desnacked@riseup.net> | 2020-01-14 12:21:29 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2020-01-14 12:21:29 +0200 |
commit | 1ba193b7a8bb5d56aa58aad3a960cd454ad0d144 (patch) | |
tree | 66ffe0f173c1f3aa5d29ca26e540cc4856f73e6f | |
parent | 8095c785f1929b379ab3341b42cbdb05c7598950 (diff) | |
parent | bbe90e3ec1b308e32f83e9f30f3706645e2b8e36 (diff) | |
download | tor-1ba193b7a8bb5d56aa58aad3a960cd454ad0d144.tar.gz tor-1ba193b7a8bb5d56aa58aad3a960cd454ad0d144.zip |
Merge branch 'tor-github/pr/1656'
-rw-r--r-- | src/feature/rend/rendcache.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/feature/rend/rendcache.c b/src/feature/rend/rendcache.c index 04748edbd5..0890a81d8f 100644 --- 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; |