mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 14:51:11 +01:00
Defensive programming: don't crash with broken node_t
Every node_t has either a routerinfo_t or a routerstatus_t, so every node_t *should* have a nickname. Nonetheless, let's make sure in hex_digest_nickname_matches(). Should quiet CID 434.
This commit is contained in:
parent
1d18c2deb6
commit
eca982d3eb
1 changed files with 2 additions and 0 deletions
|
@ -2274,6 +2274,8 @@ hex_digest_nickname_matches(const char *hexdigest, const char *identity_digest,
|
|||
return 0;
|
||||
|
||||
if (nn_char == '=' || nn_char == '~') {
|
||||
if (!nickname)
|
||||
return 0;
|
||||
if (strcasecmp(nn_buf, nickname))
|
||||
return 0;
|
||||
if (nn_char == '=' && !is_named)
|
||||
|
|
Loading…
Add table
Reference in a new issue