mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
don't let recently_chosen_ntors overflow
with commit c6f1668d we let it grow arbitrarily large.
it can still overflow, but the damage is very small now.
This commit is contained in:
+1
-1
@@ -212,7 +212,7 @@ static uint16_t
|
|||||||
decide_next_handshake_type(void)
|
decide_next_handshake_type(void)
|
||||||
{
|
{
|
||||||
/* The number of times we've chosen ntor lately when both were available. */
|
/* The number of times we've chosen ntor lately when both were available. */
|
||||||
static int recently_chosen_ntors = 0;
|
static unsigned int recently_chosen_ntors = 0;
|
||||||
|
|
||||||
if (!ol_entries[ONION_HANDSHAKE_TYPE_NTOR])
|
if (!ol_entries[ONION_HANDSHAKE_TYPE_NTOR])
|
||||||
return ONION_HANDSHAKE_TYPE_TAP; /* no ntors? try tap */
|
return ONION_HANDSHAKE_TYPE_TAP; /* no ntors? try tap */
|
||||||
|
|||||||
Reference in New Issue
Block a user