aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-03-05 09:50:26 +0000
committerNick Mathewson <nickm@torproject.org>2006-03-05 09:50:26 +0000
commit5777ee0e1a8bf0652aff75bb2c316c5bbbb4b854 (patch)
treee410cb36f9345a0aa46b735ca2128da55a68c152 /src/or/connection_edge.c
parent6a4e304d9e613b613e208bb0f11ec44c3fc30150 (diff)
downloadtor-5777ee0e1a8bf0652aff75bb2c316c5bbbb4b854.tar
tor-5777ee0e1a8bf0652aff75bb2c316c5bbbb4b854.tar.gz
Add some functions to escape values from the network before sending them to the log. Use them everywhere except for routerinfo->plaftorm, routerinfo->contact_info, and rend*.c. (need sleep now)
svn:r6087
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index f3d6fffd1..b7ac81380 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -945,7 +945,8 @@ connection_ap_handshake_rewrite_and_attach(connection_t *conn)
hostname_type_t addresstype;
tor_strlower(socks->address); /* normalize it */
- log_debug(LD_APP,"Client asked for %s:%d", safe_str(socks->address),
+ log_debug(LD_APP,"Client asked for %s:%d",
+ safe_str(socks->address),
socks->port);
/* For address map controls, remap the address */
@@ -1519,6 +1520,12 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ)
tor_free(address);
return 0;
}
+ if (!tor_strisprint(address)) {
+ log_warn(LD_PROTOCOL,"Non-printing characters in address %s in relay "
+ "begin cell. Dropping.", escaped(address));
+ tor_free(address);
+ return 0;
+ }
log_debug(LD_EXIT,"Creating new exit connection.");
n_stream = connection_new(CONN_TYPE_EXIT);