Early bailout from log_addr_has_changed() if running as client

This commit is contained in:
rl1987 2018-07-26 17:49:27 +03:00
parent 9ae3597540
commit ffdfd39d4f
2 changed files with 9 additions and 0 deletions

6
changes/bug26892 Normal file
View File

@ -0,0 +1,6 @@
o Minor bugfixes (logging):
- As a precaution, do an early return from
log_addr_has_changed() if Tor is running as client. Also,
log a stack trace for debugging as this function should only
be called when Tor runs as server. Fixes bug 26892;
bugfix on 0.1.1.9-alpha.

View File

@ -2686,6 +2686,9 @@ log_addr_has_changed(int severity,
char addrbuf_prev[TOR_ADDR_BUF_LEN];
char addrbuf_cur[TOR_ADDR_BUF_LEN];
if (BUG(!server_mode(get_options())))
return;
if (tor_addr_to_str(addrbuf_prev, prev, sizeof(addrbuf_prev), 1) == NULL)
strlcpy(addrbuf_prev, "???", TOR_ADDR_BUF_LEN);
if (tor_addr_to_str(addrbuf_cur, cur, sizeof(addrbuf_cur), 1) == NULL)