mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Add an assertion to num_ntors_per_tap().
This should please coverity, and fix CID 1415721. It didn't understand that networkstatus_get_param() always returns a value between its minimum and maximum values.
This commit is contained in:
parent
96e310911f
commit
66b07e7ec1
@ -212,10 +212,12 @@ num_ntors_per_tap(void)
|
||||
#define MIN_NUM_NTORS_PER_TAP 1
|
||||
#define MAX_NUM_NTORS_PER_TAP 100000
|
||||
|
||||
return networkstatus_get_param(NULL, "NumNTorsPerTAP",
|
||||
DEFAULT_NUM_NTORS_PER_TAP,
|
||||
MIN_NUM_NTORS_PER_TAP,
|
||||
MAX_NUM_NTORS_PER_TAP);
|
||||
int result = networkstatus_get_param(NULL, "NumNTorsPerTAP",
|
||||
DEFAULT_NUM_NTORS_PER_TAP,
|
||||
MIN_NUM_NTORS_PER_TAP,
|
||||
MAX_NUM_NTORS_PER_TAP);
|
||||
tor_assert(result > 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Choose which onion queue we'll pull from next. If one is empty choose
|
||||
|
Loading…
Reference in New Issue
Block a user