]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix another case of 12848 in circuit_handle_first_hop
authorNick Mathewson <nickm@torproject.org>
Tue, 12 Aug 2014 16:15:09 +0000 (12:15 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 12 Aug 2014 16:15:09 +0000 (12:15 -0400)
I looked for other places where we set circ->n_chan early, and found
one in circuit_handle_first_hop() right before it calls
circuit_send_next_onion_skin(). If onion_skin_create() fails there,
then n_chan will still be set when circuit_send_next_onion_skin()
returns. We should probably fix that too.

src/or/circuitbuild.c

index 11f82509343d9e8afc2a4395d034077194b746f4..5325eff64ae2cee314cd81c6f66e4078019be513 100644 (file)
@@ -475,6 +475,7 @@ circuit_handle_first_hop(origin_circuit_t *circ)
     log_debug(LD_CIRC,"Conn open. Delivering first onion skin.");
     if ((err_reason = circuit_send_next_onion_skin(circ)) < 0) {
       log_info(LD_CIRC,"circuit_send_next_onion_skin failed.");
+      circ->base_.n_chan = NULL;
       return err_reason;
     }
   }