aboutsummaryrefslogtreecommitdiff
path: root/src/or/channel.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-12 12:14:05 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-12 12:14:05 -0400
commit981e037fd3b9e20b6e58e9c1470999a0f3a1ef0e (patch)
treeb8729e89f3f3fe292c587e2b070b294b6fa213c7 /src/or/channel.c
parentb32a8b024ce3a57f8865ed2937dbc3f3fd5072ee (diff)
downloadtor-981e037fd3b9e20b6e58e9c1470999a0f3a1ef0e.tar.gz
tor-981e037fd3b9e20b6e58e9c1470999a0f3a1ef0e.zip
Add an extra check in channel_send_destroy for circID==0
Prevents other cases of 12848.
Diffstat (limited to 'src/or/channel.c')
-rw-r--r--src/or/channel.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index 1270eace7d..cd55bd0dfd 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -2625,6 +2625,14 @@ channel_send_destroy(circid_t circ_id, channel_t *chan, int reason)
cell_t cell;
tor_assert(chan);
+ if (circ_id == 0) {
+ log_warn(LD_BUG, "Attempted to send a destroy cell for circID 0 "
+ "on a channel " U64_FORMAT " at %p in state %s (%d)",
+ U64_PRINTF_ARG(chan->global_identifier),
+ chan, channel_state_to_string(chan->state),
+ chan->state);
+ return 0;
+ }
/* Check to make sure we can send on this channel first */
if (!(chan->state == CHANNEL_STATE_CLOSING ||