tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 5acfc3087663340f55de6081cdd13b484525f43a
parent 068d092749508bae84e6d5fce605d2f40c1bdb80
Author: Nick Mathewson <nickm@torproject.org>
Date:   Tue, 27 Mar 2018 18:23:53 -0400

Merge branch 'maint-0.2.9' into maint-0.3.1

Diffstat:
Achanges/bug25629 | 3+++
Msrc/or/nodelist.c | 13++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/changes/bug25629 b/changes/bug25629 @@ -0,0 +1,3 @@ + o Minor bugfixes (C correctness): + - Fix a very unlikely null pointer dereference. Fixes bug 25629; + bugfix on 0.2.9.15. Found by Coverity; this is CID 1430932. diff --git a/src/or/nodelist.c b/src/or/nodelist.c @@ -291,13 +291,12 @@ nodelist_add_microdesc(microdesc_t *md) if (rs == NULL) return NULL; node = node_get_mutable_by_id(rs->identity_digest); - if (node) { - if (node->md) - node->md->held_by_nodes--; - node->md = md; - md->held_by_nodes++; - } - + if (node == NULL) + return NULL; + if (node->md) + node->md->held_by_nodes--; + node->md = md; + md->held_by_nodes++; node_add_to_address_set(node); return node;