aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-10-27 06:48:16 +0000
committerNick Mathewson <nickm@torproject.org>2004-10-27 06:48:16 +0000
commit6980929e647b7a73e0634d9f699f18d462b8beca (patch)
tree26b722a9ed0981558ccf0a2c6cc45543ca91ffbf /src/or/connection_edge.c
parent44d4516155309e15b3463a543aef6239d485a04e (diff)
downloadtor-6980929e647b7a73e0634d9f699f18d462b8beca.tar
tor-6980929e647b7a73e0634d9f699f18d462b8beca.tar.gz
Use strlcpy, not strcpy.
svn:r2610
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index ed2b7f15e..6db4b5237 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -419,7 +419,7 @@ static int connection_ap_handshake_process_socks(connection_t *conn) {
return 0;
}
- strcpy(conn->rend_query, socks->address); /* this strcpy is safe -RD */
+ strlcpy(conn->rend_query, socks->address, sizeof(conn->rend_query));
log_fn(LOG_INFO,"Got a hidden service request for ID '%s'", conn->rend_query);
/* see if we already have it cached */
r = rend_cache_lookup_entry(conn->rend_query, &entry);
@@ -594,7 +594,8 @@ int connection_ap_make_bridge(char *address, uint16_t port) {
/* leave version at zero, so the socks_reply is empty */
conn->socks_request->socks_version = 0;
conn->socks_request->has_finished = 0; /* waiting for 'connected' */
- strcpy(conn->socks_request->address, address);
+ strlcpy(conn->socks_request->address, address,
+ sizeof(conn->socks_request->address));
conn->socks_request->port = port;
conn->socks_request->command = SOCKS_COMMAND_CONNECT;
@@ -775,7 +776,8 @@ int connection_exit_begin_conn(cell_t *cell, circuit_t *circ) {
log_fn(LOG_DEBUG,"begin is for rendezvous. configuring stream.");
n_stream->address = tor_strdup("(rendezvous)");
n_stream->state = EXIT_CONN_STATE_CONNECTING;
- strcpy(n_stream->rend_query, circ->rend_query);
+ strlcpy(n_stream->rend_query, circ->rend_query,
+ sizeof(n_stream->rend_query));
tor_assert(connection_edge_is_rendezvous_stream(n_stream));
assert_circuit_ok(circ);
if(rend_service_set_connection_addr_port(n_stream, circ) < 0) {