tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit f2aeaaf71d2074019a7f50185f78a36dfb18b9e5
parent 1b63eea66cbb8793a3cff05de8d856ce3b93fc17
Author: Nick Mathewson <nickm@torproject.org>
Date:   Tue,  7 Jan 2020 08:09:27 -0500

Add new state to connection_proxy_state_to_string()

Also, add a CTASSERT() to make sure that we don't let this array get
out-of-sync again.

Found by coverity; this is CID 1457528.

Diffstat:
Msrc/core/mainloop/connection.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c @@ -107,6 +107,7 @@ #include "lib/crypt_ops/crypto_util.h" #include "lib/geoip/geoip.h" +#include "lib/cc/ctassert.h" #include "lib/sandbox/sandbox.h" #include "lib/net/buffers_net.h" #include "lib/tls/tortls.h" @@ -2284,9 +2285,12 @@ connection_proxy_state_to_string(int state) "PROXY_SOCKS5_WANT_AUTH_METHOD_RFC1929", "PROXY_SOCKS5_WANT_AUTH_RFC1929_OK", "PROXY_SOCKS5_WANT_CONNECT_OK", + "PROXY_HAPROXY_WAIT_FOR_FLUSH", "PROXY_CONNECTED", }; + CTASSERT(ARRAY_LENGTH(states) == PROXY_CONNECTED+1); + if (state < PROXY_NONE || state > PROXY_CONNECTED) return unknown;