From 7427cf5d5607f4ced7c76b02b55449a0d8f31333 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 20 Feb 2008 00:57:37 +0000 Subject: [PATCH] don't throw around an int for relay_command if we're going to squeeze it into a uint8_t later. also reported by veracode. svn:r13607 --- src/or/or.h | 4 ++-- src/or/relay.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/or/or.h b/src/or/or.h index a3ca0e94eb..59e60b51a1 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3511,10 +3511,10 @@ int circuit_receive_relay_cell(cell_t *cell, circuit_t *circ, void relay_header_pack(char *dest, const relay_header_t *src); void relay_header_unpack(relay_header_t *dest, const char *src); int relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ, - int relay_command, const char *payload, + uint8_t relay_command, const char *payload, size_t payload_len, crypt_path_t *cpath_layer); int connection_edge_send_command(edge_connection_t *fromconn, - int relay_command, const char *payload, + uint8_t relay_command, const char *payload, size_t payload_len); int connection_edge_package_raw_inbuf(edge_connection_t *conn, int package_partial); diff --git a/src/or/relay.c b/src/or/relay.c index dd999e9eb0..0dc79e4488 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -466,7 +466,7 @@ relay_header_unpack(relay_header_t *dest, const char *src) */ int relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ, - int relay_command, const char *payload, + uint8_t relay_command, const char *payload, size_t payload_len, crypt_path_t *cpath_layer) { cell_t cell; @@ -526,7 +526,7 @@ relay_send_command_from_edge(uint16_t stream_id, circuit_t *circ, */ int connection_edge_send_command(edge_connection_t *fromconn, - int relay_command, const char *payload, + uint8_t relay_command, const char *payload, size_t payload_len) { /* XXXX NM Split this function into a separate versions per circuit type? */ @@ -1486,7 +1486,7 @@ circuit_consider_sending_sendme(circuit_t *circ, crypt_path_t *layer_hint) if (relay_send_command_from_edge(0, circ, RELAY_COMMAND_SENDME, NULL, 0, layer_hint) < 0) { log_warn(LD_CIRC, - "connection_edge_send_command failed. Circuit's closed."); + "relay_send_command_from_edge failed. Circuit's closed."); return; /* the circuit's closed, don't continue */ } }