diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2011-04-26 04:23:35 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-09 13:19:45 -0400 |
commit | 1827e60976d54d1917dfc54bdf62b4818662ac12 (patch) | |
tree | 6391268aa06f48a54640f3730114a35ca2f7ffe1 /src/or/microdesc.c | |
parent | 8ebb3ce6e27c104e35d65662c04d23795f2b5605 (diff) | |
download | tor-1827e60976d54d1917dfc54bdf62b4818662ac12.tar.gz tor-1827e60976d54d1917dfc54bdf62b4818662ac12.zip |
Fix a potential null deref when rebuilding md cache
Issue discovered using clang's static analyzer
Diffstat (limited to 'src/or/microdesc.c')
-rw-r--r-- | src/or/microdesc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/microdesc.c b/src/or/microdesc.c index 73d2285009..5740c40d5f 100644 --- a/src/or/microdesc.c +++ b/src/or/microdesc.c @@ -423,7 +423,7 @@ microdesc_cache_rebuild(microdesc_cache_t *cache, int force) cache->journal_len = 0; cache->bytes_dropped = 0; - new_size = (int)cache->cache_content->size; + new_size = cache->cache_content ? (int)cache->cache_content->size : 0; log_info(LD_DIR, "Done rebuilding microdesc cache. " "Saved %d bytes; %d still used.", orig_size-new_size, new_size); |