Commit b444096b authored by Nick Mathewson's avatar Nick Mathewson 🎨
Browse files

Fix a boolean logic error when logging about invalid hostnames.

Fixes bug 34131; bugfix on 0.4.3.1-alpha.
parent b7fcbb28
o Minor bugfixes (logging):
- Fix a logic error in a log message about whether an address was
invalid. Previously, the code would never report that onion addresses
were onion addresses. Fixes bug 34131; bugfix on 0.4.3.1-alpha.
...@@ -1643,9 +1643,11 @@ parse_extended_hostname(char *address, hostname_type_t *type_out) ...@@ -1643,9 +1643,11 @@ parse_extended_hostname(char *address, hostname_type_t *type_out)
failed: failed:
/* otherwise, return to previous state and return 0 */ /* otherwise, return to previous state and return 0 */
*s = '.'; *s = '.';
const bool is_onion = (*type_out == ONION_V2_HOSTNAME) ||
(*type_out == ONION_V3_HOSTNAME);
log_warn(LD_APP, "Invalid %shostname %s; rejecting", log_warn(LD_APP, "Invalid %shostname %s; rejecting",
(*type_out == (ONION_V2_HOSTNAME || ONION_V3_HOSTNAME) ? "onion " : ""), is_onion ? "onion " : "",
safe_str_client(address)); safe_str_client(address));
return false; return false;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment