]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix NULL pointer deref in logs
authorMike Perry <mikeperry-git@torproject.org>
Wed, 13 Oct 2021 21:06:33 +0000 (21:06 +0000)
committerMike Perry <mikeperry-git@torproject.org>
Tue, 22 Feb 2022 19:28:35 +0000 (19:28 +0000)
src/core/or/congestion_control_common.c
src/core/or/congestion_control_nola.c
src/core/or/congestion_control_vegas.c
src/core/or/congestion_control_westwood.c

index e316b631d17591e9ff28f2f744bbd9b36e257b39..6fa3bb9a11d5e53baae2ece99ac584e858cf3e61 100644 (file)
@@ -1040,9 +1040,8 @@ congestion_control_update_circuit_bdp(congestion_control_t *cc,
                  "%"PRIu64", "
                  "%"PRIu64", "
                  "%"PRIu64". ",
-                 // XXX: actually, is this p_chan here? This is
-                 // an or_circuit (exit or onion)
-                 circ->n_chan->global_identifier, circ->n_circ_id,
+                 CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
+                 CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
                  cc->min_rtt_usec/1000,
                  curr_rtt_usec/1000,
                  cc->ewma_rtt_usec/1000,
index 09f88d469944931a63369b4f4732957b4876b2c1..52d41157a2cdb81c5cf668c4cc654d65a18a732a 100644 (file)
@@ -111,7 +111,8 @@ congestion_control_nola_process_sendme(congestion_control_t *cc,
                "INFL: %"PRIu64", "
                "NCCE: %"PRIu64", "
                "SS: %d",
-               circ->n_chan->global_identifier, circ->n_circ_id,
+             CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
+             CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
              cc->cwnd,
              cc->inflight,
              cc->next_cc_event,
index e7ed838478197078a46cb1b13c92e451c7506005..d823a5068ea14474c44c3d0c1f8d71c298ff4a03 100644 (file)
@@ -255,7 +255,8 @@ congestion_control_vegas_process_sendme(congestion_control_t *cc,
                  "QUSE: %"PRIu64", "
                  "NCCE: %"PRIu64", "
                  "SS: %d",
-                 circ->n_chan->global_identifier, circ->n_circ_id,
+               CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
+               CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
                cc->cwnd,
                cc->inflight,
                vegas_bdp_mix(cc),
index 4b24234212219af96f19b6f2c368c4b86a2a03ba..357cdeb3b9b53085f87810124108e7d0cbc6c877 100644 (file)
@@ -213,7 +213,8 @@ congestion_control_westwood_process_sendme(congestion_control_t *cc,
                  "WRTT: %"PRIu64", "
                  "WSIG: %"PRIu64", "
                  "SS: %d",
-               circ->n_chan->global_identifier, circ->n_circ_id,
+               CONST_TO_OR_CIRCUIT(circ)->p_chan->global_identifier,
+               CONST_TO_OR_CIRCUIT(circ)->p_circ_id,
                cc->cwnd,
                cc->inflight,
                cc->next_cc_event,