diff options
author | Neel Chauhan <neel@neelc.org> | 2017-11-16 12:58:37 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-11-17 08:42:07 -0500 |
commit | b8addf97463d9338558ec7c0b97b48eaa476fc55 (patch) | |
tree | a4c202be136c4aa1bc2665ae2344769894d0905b /src/or/hs_circuit.c | |
parent | 27d34f36e07b876321a03fbb59533b72b807b679 (diff) | |
download | tor-b8addf97463d9338558ec7c0b97b48eaa476fc55.tar.gz tor-b8addf97463d9338558ec7c0b97b48eaa476fc55.zip |
Use memset() on intro1_data in hs_circ_send_introduce1()
Diffstat (limited to 'src/or/hs_circuit.c')
-rw-r--r-- | src/or/hs_circuit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/hs_circuit.c b/src/or/hs_circuit.c index 9e7709504b..7f5bbdaaf4 100644 --- a/src/or/hs_circuit.c +++ b/src/or/hs_circuit.c @@ -1101,6 +1101,11 @@ hs_circ_send_introduce1(origin_circuit_t *intro_circ, tor_assert(ip); tor_assert(subcredential); + /* It is undefined behavior in hs_cell_introduce1_data_clear() if intro1_data + * has been declared on the stack but not initialized. Here, we set it to 0. + */ + memset(&intro1_data, 0, sizeof(hs_cell_introduce1_data_t)); + /* This takes various objects in order to populate the introduce1 data * object which is used to build the content of the cell. */ const node_t *exit_node = build_state_get_exit_node(rend_circ->build_state); |