mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
Fix CID 1430932
Coverity found a null pointer reference in nodelist_add_microdesc(). This is almost certainly impossible assuming that the routerstatus_t returned by router_get_consensus_status_by_descriptor_digest() always corresponds to an entry in the nodelist. Fixes bug 25629.
This commit is contained in:
parent
b5a6c03998
commit
0c13a84c0d
3
changes/bug25629
Normal file
3
changes/bug25629
Normal file
@ -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.
|
@ -525,7 +525,9 @@ nodelist_add_microdesc(microdesc_t *md)
|
||||
if (rs == NULL)
|
||||
return NULL;
|
||||
node = node_get_mutable_by_id(rs->identity_digest);
|
||||
if (node) {
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
node_remove_from_ed25519_map(node);
|
||||
if (node->md)
|
||||
node->md->held_by_nodes--;
|
||||
@ -539,8 +541,6 @@ nodelist_add_microdesc(microdesc_t *md)
|
||||
node_set_hsdir_index(node, ns);
|
||||
}
|
||||
node_add_to_ed25519_map(node);
|
||||
}
|
||||
|
||||
node_add_to_address_set(node);
|
||||
|
||||
return node;
|
||||
|
Loading…
Reference in New Issue
Block a user