aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-12-18 10:32:50 -0500
committerNick Mathewson <nickm@torproject.org>2015-12-18 10:32:50 -0500
commit9b1c491ec602c936ca9d75e1e55bddbb95056fee (patch)
tree8bad52c77effbbcc172bc6dc4fb1d92f3a582baa /src/test/test_connection.c
parent498897e33d1e32054f0c5cd23f8f0850785733db (diff)
downloadtor-9b1c491ec602c936ca9d75e1e55bddbb95056fee.tar.gz
tor-9b1c491ec602c936ca9d75e1e55bddbb95056fee.zip
Fix a buffer overrun in connection tests.
This is CID 1343601.
Diffstat (limited to 'src/test/test_connection.c')
-rw-r--r--src/test/test_connection.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index f6e08fdf1f..dab6f2bbb6 100644
--- a/src/test/test_connection.c
+++ b/src/test/test_connection.c
@@ -231,9 +231,10 @@ test_conn_get_rend_setup(const struct testcase_t *tc)
/* TODO: use directory_initiate_command_rend() to do this - maybe? */
conn->rend_data = tor_malloc_zero(sizeof(rend_data_t));
+ tor_assert(strlen(TEST_CONN_REND_ADDR) == REND_SERVICE_ID_LEN_BASE32);
memcpy(conn->rend_data->onion_address,
TEST_CONN_REND_ADDR,
- REND_SERVICE_ADDRESS_LEN+1);
+ REND_SERVICE_ID_LEN_BASE32+1);
conn->rend_data->hsdirs_fp = smartlist_new();
conn->base_.purpose = TEST_CONN_REND_PURPOSE;