summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_circuit.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-12-03 10:11:42 -0500
committerDavid Goulet <dgoulet@torproject.org>2019-12-03 10:11:42 -0500
commit3b64c6b6fc1f41ccfae99b49a56f134ba6ee7662 (patch)
tree2aae1bac2cfe40b5bc67edaff873da53af678931 /src/feature/hs/hs_circuit.c
parent65759f29019ed4cd33502fef9b06bb92aa6e348a (diff)
downloadtor-3b64c6b6fc1f41ccfae99b49a56f134ba6ee7662.tar.gz
tor-3b64c6b6fc1f41ccfae99b49a56f134ba6ee7662.zip
hs-v3: Fix NULL deref. in hs_circ_service_get_established_intro_circ()
Found by Stem regression tests. Reported by atagar. Fixes #32664 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_circuit.c')
-rw-r--r--src/feature/hs/hs_circuit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/feature/hs/hs_circuit.c b/src/feature/hs/hs_circuit.c
index a43e7f0e23..a09e319729 100644
--- a/src/feature/hs/hs_circuit.c
+++ b/src/feature/hs/hs_circuit.c
@@ -673,7 +673,8 @@ hs_circ_service_get_established_intro_circ(const hs_service_intro_point_t *ip)
}
/* Only return circuit if it is established. */
- return (TO_CIRCUIT(circ)->purpose == CIRCUIT_PURPOSE_S_INTRO) ? circ : NULL;
+ return (circ && TO_CIRCUIT(circ)->purpose == CIRCUIT_PURPOSE_S_INTRO) ?
+ circ : NULL;
}
/** Called when we fail building a rendezvous circuit at some point other than