#31609: Make CIRCUIT_IS_ORIGIN() look at the base magic number ------------------------------+-------------------------------- Reporter: dgoulet | Owner: (none) Type: defect | Status: new Priority: Medium | Milestone: Tor: 0.4.2.x-final Component: Core Tor/Tor | Version: Severity: Normal | Keywords: tor-circuit Actual Points: | Parent ID: Points: 0.1 | Reviewer: Sponsor: | ------------------------------+-------------------------------- Currently, `CIRCUIT_IS_ORIGIN()` actually looks at the purpose, not the base magic number:
{{{ #define CIRCUIT_IS_ORIGIN(c) (CIRCUIT_PURPOSE_IS_ORIGIN((c)->purpose)) }}} We should move it to look at the `magic` like `CIRCUIT_IS_ORCIRC()` is doing. The reason is because I was adding tracing events to the circuit subsystem and I kept having state transition event with a circuit global identifier of 0 which can't be because that value is set just after allocation. But at that point, the purpose has not been set so `CIRCUIT_IS_ORIGIN()` wasn't returning true. Furthermore, this made me discover another issue documented in #31608 where if we do make this change, we _must_ fix this ticket else we have a NULL deref. -- Ticket URL: <https://trac.torproject.org/projects/tor/ticket/31609> Tor Bug Tracker & Wiki <https://trac.torproject.org/> The Tor Project: anonymity online
_______________________________________________ tor-bugs mailing list tor-bugs@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs