[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Fix a buffer overrun in connection tests.
commit 9b1c491ec602c936ca9d75e1e55bddbb95056fee
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Fri Dec 18 10:32:50 2015 -0500
Fix a buffer overrun in connection tests.
This is CID 1343601.
---
src/test/test_connection.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/test/test_connection.c b/src/test/test_connection.c
index f6e08fd..dab6f2b 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;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits