diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-11-27 11:21:51 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-11-27 11:21:51 -0500 |
commit | 5665775e8c822d45282d1d56a01a0f5883c7b070 (patch) | |
tree | 9390d5251bdfa2f92de3dc9c655790a8bd3c948b /src/or | |
parent | 0c7bfb206ea14ea3115c1b8b214ec79f5e6694e1 (diff) | |
download | tor-5665775e8c822d45282d1d56a01a0f5883c7b070.tar.gz tor-5665775e8c822d45282d1d56a01a0f5883c7b070.zip |
Check magic number in connection_ap_attach_pending
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/connection_edge.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 496fe21b11..8b2f635b23 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -799,6 +799,12 @@ connection_ap_attach_pending(int retry) SMARTLIST_DEL_CURRENT(pending_entry_connections, entry_conn); continue; } + if (conn->magic != ENTRY_CONNECTION_MAGIC) { + log_warn(LD_BUG, "%p has impossible magic value %u", + entry_conn, (unsigned)conn->magic); + SMARTLIST_DEL_CURRENT(pending_entry_connections, entry_conn); + continue; + } if (conn->state != AP_CONN_STATE_CIRCUIT_WAIT) { log_warn(LD_BUG, "%p is no longer in circuit_wait. Its current state " "is %s. Why is it on pending_entry_connections?", |