]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add an extra check in channel_send_destroy for circID==0
authorNick Mathewson <nickm@torproject.org>
Tue, 12 Aug 2014 16:14:05 +0000 (12:14 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 12 Aug 2014 16:14:05 +0000 (12:14 -0400)
Prevents other cases of 12848.

src/or/channel.c

index 1270eace7d7b0dc1652ce39ed8d8e4542760080d..cd55bd0dfd6e8e1210897c60c016a7dd739c9d3b 100644 (file)
@@ -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 ||