aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2023-07-31 14:12:39 +0000
committerMike Perry <mikeperry-git@torproject.org>2023-07-31 14:12:39 +0000
commit74d6fd534a4619f73b642f12d0fa9d00f247c804 (patch)
treecd2622fb948c2f5fb883b05a57cb09ae0d441c11 /src/core
parent4667195deded5e34d93ef9984ff091b2ae822fbb (diff)
downloadtor-74d6fd534a4619f73b642f12d0fa9d00f247c804.tar.gz
tor-74d6fd534a4619f73b642f12d0fa9d00f247c804.zip
Bug 40828: Add more log scrubbing to protocol warnings
Diffstat (limited to 'src/core')
-rw-r--r--src/core/mainloop/mainloop.c4
-rw-r--r--src/core/or/relay.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c
index 3702f3a74e..658b4b47ee 100644
--- a/src/core/mainloop/mainloop.c
+++ b/src/core/mainloop/mainloop.c
@@ -1271,8 +1271,8 @@ run_connection_housekeeping(int i, time_t now)
log_fn(LOG_PROTOCOL_WARN,LD_PROTOCOL,
"Expiring stuck OR connection to fd %d (%s:%d). (%d bytes to "
"flush; %d seconds since last write)",
- (int)conn->s, fmt_and_decorate_addr(&conn->addr), conn->port,
- (int)connection_get_outbuf_len(conn),
+ (int)conn->s, safe_str(fmt_and_decorate_addr(&conn->addr)),
+ conn->port, (int)connection_get_outbuf_len(conn),
(int)(now-conn->timestamp_last_write_allowed));
connection_or_close_normally(TO_OR_CONN(conn), 0);
} else if (past_keepalive && !connection_get_outbuf_len(conn)) {
diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 2c722f01cc..3af9435a76 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -1469,7 +1469,7 @@ connection_edge_process_relay_cell_not_open(
(get_options()->ClientDNSRejectInternalAddresses &&
tor_addr_is_internal(&addr, 0))) {
log_info(LD_APP, "...but it claims the IP address was %s. Closing.",
- fmt_addr(&addr));
+ safe_str(fmt_addr(&addr)));
connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL);
connection_mark_unattached_ap(entry_conn,
END_STREAM_REASON_TORPROTOCOL);
@@ -1480,7 +1480,7 @@ connection_edge_process_relay_cell_not_open(
(family == AF_INET6 && ! entry_conn->entry_cfg.ipv6_traffic)) {
log_fn(LOG_PROTOCOL_WARN, LD_APP,
"Got a connected cell to %s with unsupported address family."
- " Closing.", fmt_addr(&addr));
+ " Closing.", safe_str(fmt_addr(&addr)));
connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL);
connection_mark_unattached_ap(entry_conn,
END_STREAM_REASON_TORPROTOCOL);