aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/versions.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-11-21 07:38:38 -0500
committerNick Mathewson <nickm@torproject.org>2018-11-21 07:56:33 -0500
commit469f47ef8dc8b18104108f0437c860ec88fca6ad (patch)
treebdb029d498445cca120021665c3c0d16aa2340f7 /src/core/or/versions.c
parentb406fdae4fff9a6495a9ad319e7f2b565de52ac8 (diff)
downloadtor-469f47ef8dc8b18104108f0437c860ec88fca6ad.tar.gz
tor-469f47ef8dc8b18104108f0437c860ec88fca6ad.zip
Fix a fun heisenbug in memoize_protover_flags()
After we clear the protover map for getting full, we need to re-create it, since we are about to use it. This is a bugfix for bug 28558. It is a bugfix for the code from ticket 27225, which is not in any released Tor. Found by Google OSS-Fuzz, as issue 11475.
Diffstat (limited to 'src/core/or/versions.c')
-rw-r--r--src/core/or/versions.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/or/versions.c b/src/core/or/versions.c
index 6f8eea7a67..5d4effcaf8 100644
--- a/src/core/or/versions.c
+++ b/src/core/or/versions.c
@@ -399,6 +399,7 @@ memoize_protover_summary(protover_summary_flags_t *out,
if (strmap_size(protover_summary_map) >= MAX_PROTOVER_SUMMARY_MAP_LEN) {
protover_summary_cache_free_all();
+ protover_summary_map = strmap_new();
}
const protover_summary_flags_t *cached =