diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-09-12 21:09:18 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-12 21:32:42 -0400 |
commit | 4ff170d7b1cbe4074cb85271b82a8963eccc8286 (patch) | |
tree | 459640c64a49ee1342338647cd67570cac605516 /src/test/test_hs_intropoint.c | |
parent | 491b6de1684e519d1fec870a5b46a4bb540cbc13 (diff) | |
download | tor-4ff170d7b1cbe4074cb85271b82a8963eccc8286.tar.gz tor-4ff170d7b1cbe4074cb85271b82a8963eccc8286.zip |
Fix warnings about passing uninitialized buffers into functions
Most of these buffers were never actually inspected, but it's still
bad style.
Diffstat (limited to 'src/test/test_hs_intropoint.c')
-rw-r--r-- | src/test/test_hs_intropoint.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c index 2cce8a3703..1e570630c0 100644 --- a/src/test/test_hs_intropoint.c +++ b/src/test/test_hs_intropoint.c @@ -783,7 +783,7 @@ static void test_received_introduce1_handling(void *arg) { int ret; - uint8_t *request = NULL, buf[128]; + uint8_t *request = NULL, buf[128];; trn_cell_introduce1_t *cell = NULL; or_circuit_t *circ = NULL; @@ -796,6 +796,7 @@ test_received_introduce1_handling(void *arg) /* Too small request length. An INTRODUCE1 expect at the very least a * DIGEST_LEN size. */ { + memset(buf, 0, sizeof(buf)); circ = helper_create_intro_circuit(); ret = hs_intro_received_introduce1(circ, buf, DIGEST_LEN - 1); tt_int_op(ret, OP_EQ, -1); @@ -809,6 +810,7 @@ test_received_introduce1_handling(void *arg) { circ = helper_create_intro_circuit(); uint8_t test[2]; /* Too small request. */ + memset(test, 0, sizeof(test)); ret = handle_introduce1(circ, test, sizeof(test)); tor_free(circ->p_chan); circuit_free(TO_CIRCUIT(circ)); |