summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-03-10 08:32:58 -0400
committerNick Mathewson <nickm@torproject.org>2013-03-10 19:52:06 -0400
commit339df5df085e2115c01881cf628abe5ed3fbd456 (patch)
tree3a7e4f2f2c695e7506eda20e3637081f6fb5009a /src/or/connection_edge.c
parent74c33945e3c8c441111f0cb3dd0e5097ad2155f5 (diff)
downloadtor-339df5df085e2115c01881cf628abe5ed3fbd456.tar.gz
tor-339df5df085e2115c01881cf628abe5ed3fbd456.zip
Fix 8447: use %u to format circid_t.
Now that circid_t is 4 bytes long, the default integer promotions will leave it alone when sizeof(int) == 4, which will leave us formatting an unsigned as an int. That's technically undefined behavior. Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not in any released Tor.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index fcbcb95919..84d556513c 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -218,8 +218,8 @@ int
connection_edge_destroy(circid_t circ_id, edge_connection_t *conn)
{
if (!conn->base_.marked_for_close) {
- log_info(LD_EDGE,
- "CircID %d: At an edge. Marking connection for close.", circ_id);
+ log_info(LD_EDGE, "CircID %u: At an edge. Marking connection for close.",
+ (unsigned) circ_id);
if (conn->base_.type == CONN_TYPE_AP) {
entry_connection_t *entry_conn = EDGE_TO_ENTRY_CONN(conn);
connection_mark_unattached_ap(entry_conn, END_STREAM_REASON_DESTROY);
@@ -1847,8 +1847,8 @@ connection_ap_handshake_send_begin(entry_connection_t *ap_conn)
edge_conn->deliver_window = STREAMWINDOW_START;
base_conn->state = AP_CONN_STATE_CONNECT_WAIT;
log_info(LD_APP,"Address/port sent, ap socket "TOR_SOCKET_T_FORMAT
- ", n_circ_id %d",
- base_conn->s, circ->base_.n_circ_id);
+ ", n_circ_id %u",
+ base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_CONNECT, 0);
/* If there's queued-up data, send it now */
@@ -1949,8 +1949,8 @@ connection_ap_handshake_send_resolve(entry_connection_t *ap_conn)
base_conn->address = tor_strdup("(Tor_internal)");
base_conn->state = AP_CONN_STATE_RESOLVE_WAIT;
log_info(LD_APP,"Address sent for resolve, ap socket "TOR_SOCKET_T_FORMAT
- ", n_circ_id %d",
- base_conn->s, circ->base_.n_circ_id);
+ ", n_circ_id %u",
+ base_conn->s, (unsigned)circ->base_.n_circ_id);
control_event_stream_status(ap_conn, STREAM_EVENT_NEW, 0);
control_event_stream_status(ap_conn, STREAM_EVENT_SENT_RESOLVE, 0);
return 0;