diff options
author | David Goulet <dgoulet@torproject.org> | 2017-09-21 13:13:44 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-09-21 13:13:53 -0400 |
commit | 6045bdd4a0542ef11dc46d98495686172015a961 (patch) | |
tree | 4816d7d79c95f65c92682ee26939114732c4ba6d /src/or/hs_intropoint.c | |
parent | 4c7a89a226be2f75400f3fc22d19ec9c31acd891 (diff) | |
download | tor-6045bdd4a0542ef11dc46d98495686172015a961.tar.gz tor-6045bdd4a0542ef11dc46d98495686172015a961.zip |
hs: Avoid possible double circuit close on error
Fixes #23610
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_intropoint.c')
-rw-r--r-- | src/or/hs_intropoint.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c index cb4d6c02e5..4a5202f614 100644 --- a/src/or/hs_intropoint.c +++ b/src/or/hs_intropoint.c @@ -255,7 +255,11 @@ handle_establish_intro(or_circuit_t *circ, const uint8_t *request, goto done; err: - circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL); + /* When sending the intro establish ack, on error the circuit can be marked + * as closed so avoid a double close. */ + if (!TO_CIRCUIT(circ)->marked_for_close) { + circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL); + } done: trn_cell_establish_intro_free(parsed_cell); |