aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-21 13:13:44 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-22 09:09:13 -0400
commitdc5c9af6c383b97b47f86b3860e9693686bf0466 (patch)
tree0c08bfce3b21a6042f7296364d64459e53981467 /src
parent746410fb24055db0046a6d70986efcc6e3d10281 (diff)
downloadtor-dc5c9af6c383b97b47f86b3860e9693686bf0466.tar.gz
tor-dc5c9af6c383b97b47f86b3860e9693686bf0466.zip
hs: Avoid possible double circuit close on error
Fixes #23610 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src')
-rw-r--r--src/or/hs_intropoint.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c
index e065ef64f4..bc493e297e 100644
--- a/src/or/hs_intropoint.c
+++ b/src/or/hs_intropoint.c
@@ -253,7 +253,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:
hs_cell_establish_intro_free(parsed_cell);