[or-cvs] fix the stale pointer assert bug reported by joe magic
Roger Dingledine
arma at seul.org
Mon Oct 11 01:17:45 UTC 2004
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or
Modified Files:
circuitbuild.c circuitlist.c circuituse.c
Log Message:
fix the stale pointer assert bug reported by joe magic
Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuitbuild.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- circuitbuild.c 30 Sep 2004 15:40:05 -0000 1.35
+++ circuitbuild.c 11 Oct 2004 01:17:42 -0000 1.36
@@ -633,8 +633,8 @@
* just give up: for circ to close, and return 0.
*/
int circuit_truncated(circuit_t *circ, crypt_path_t *layer) {
- crypt_path_t *victim;
- connection_t *stream;
+// crypt_path_t *victim;
+// connection_t *stream;
tor_assert(circ && CIRCUIT_IS_ORIGIN(circ));
tor_assert(layer);
@@ -646,6 +646,7 @@
circuit_mark_for_close(circ);
return 0;
+#if 0
while(layer->next != circ->cpath) {
/* we need to clear out layer->next */
victim = layer->next;
@@ -668,6 +669,7 @@
log_fn(LOG_INFO, "finished");
return 0;
+#endif
}
/** Decide whether the first bit of the circuit ID will be
Index: circuitlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuitlist.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- circuitlist.c 29 Sep 2004 06:52:35 -0000 1.10
+++ circuitlist.c 11 Oct 2004 01:17:42 -0000 1.11
@@ -411,6 +411,7 @@
tor_assert(cp->handshake_state);
break;
default:
+ log_fn(LOG_WARN,"Unexpected state %d",cp->state);
tor_assert(0);
}
tor_assert(cp->package_window >= 0);
Index: circuituse.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuituse.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- circuituse.c 3 Oct 2004 19:39:29 -0000 1.14
+++ circuituse.c 11 Oct 2004 01:17:42 -0000 1.15
@@ -333,6 +333,8 @@
tor_assert(circ && conn);
+ conn->cpath_layer = NULL; /* make sure we don't keep a stale pointer */
+
if(conn == circ->p_streams) {
circ->p_streams = conn->next_stream;
return;
More information about the tor-commits
mailing list