diff options
author | Roger Dingledine <arma@torproject.org> | 2009-11-23 10:13:50 -0500 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2009-11-23 10:13:50 -0500 |
commit | a89f51c936f8bd3c2aef3e9472d5310c83dc8fa7 (patch) | |
tree | 60ccea3b5df380caa39dd34c35a9bd3eee27971e /src | |
parent | 0656c12b077f1241ca9b3b471b3d5f1b34dead94 (diff) | |
download | tor-a89f51c936f8bd3c2aef3e9472d5310c83dc8fa7.tar tor-a89f51c936f8bd3c2aef3e9472d5310c83dc8fa7.tar.gz |
fix race condition that can cause crashes at client or exit relay
Avoid crashing if the client is trying to upload many bytes and the
circuit gets torn down at the same time, or if the flip side
happens on the exit relay. Bugfix on 0.2.0.1-alpha; fixes bug 1150.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitlist.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c index 5918bdd7a..c55ba4dee 100644 --- a/src/or/circuitlist.c +++ b/src/or/circuitlist.c @@ -1097,6 +1097,7 @@ _circuit_mark_for_close(circuit_t *circ, int reason, int line, edge_connection_t *conn; for (conn=or_circ->n_streams; conn; conn=conn->next_stream) connection_edge_destroy(or_circ->p_circ_id, conn); + or_circ->n_streams = NULL; while (or_circ->resolving_streams) { conn = or_circ->resolving_streams; @@ -1120,6 +1121,7 @@ _circuit_mark_for_close(circuit_t *circ, int reason, int line, edge_connection_t *conn; for (conn=ocirc->p_streams; conn; conn=conn->next_stream) connection_edge_destroy(circ->n_circ_id, conn); + ocirc->p_streams = NULL; } circ->marked_for_close = line; |