mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Merge branch 'tor-github/pr/938'
This commit is contained in:
commit
78223ab0fc
3
changes/ticket30149
Normal file
3
changes/ticket30149
Normal file
@ -0,0 +1,3 @@
|
||||
o Code simplification and refactoring:
|
||||
- Add several assertions in an attempt to fix some Coverity warnings.
|
||||
Closes ticket 30149.
|
@ -218,7 +218,7 @@ problem include-count /src/feature/nodelist/networkstatus.c 61
|
||||
problem function-size /src/feature/nodelist/networkstatus.c:networkstatus_check_consensus_signature() 176
|
||||
problem function-size /src/feature/nodelist/networkstatus.c:networkstatus_set_current_consensus() 293
|
||||
problem function-size /src/feature/nodelist/node_select.c:router_pick_directory_server_impl() 123
|
||||
problem function-size /src/feature/nodelist/node_select.c:compute_weighted_bandwidths() 205
|
||||
problem function-size /src/feature/nodelist/node_select.c:compute_weighted_bandwidths() 206
|
||||
problem function-size /src/feature/nodelist/node_select.c:router_pick_trusteddirserver_impl() 114
|
||||
problem function-size /src/feature/nodelist/nodelist.c:compute_frac_paths_available() 193
|
||||
problem file-size /src/feature/nodelist/routerlist.c 3234
|
||||
|
@ -176,6 +176,7 @@ pathbias_get_scale_threshold(const or_options_t *options)
|
||||
static double
|
||||
pathbias_get_scale_ratio(const or_options_t *options)
|
||||
{
|
||||
(void) options;
|
||||
/*
|
||||
* The scale factor is the denominator for our scaling
|
||||
* of circuit counts for our path bias window.
|
||||
@ -185,7 +186,8 @@ pathbias_get_scale_ratio(const or_options_t *options)
|
||||
*/
|
||||
int denominator = networkstatus_get_param(NULL, "pb_scalefactor",
|
||||
2, 2, INT32_MAX);
|
||||
(void) options;
|
||||
tor_assert(denominator > 0);
|
||||
|
||||
/**
|
||||
* The mult factor is the numerator for our scaling
|
||||
* of circuit counts for our path bias window. It
|
||||
|
@ -585,6 +585,7 @@ compute_weighted_bandwidths(const smartlist_t *sl,
|
||||
}
|
||||
|
||||
weight_scale = networkstatus_get_weight_scale_param(NULL);
|
||||
tor_assert(weight_scale >= 1);
|
||||
|
||||
if (rule == WEIGHT_FOR_GUARD) {
|
||||
Wg = networkstatus_get_bw_weight(NULL, "Wgg", -1);
|
||||
|
@ -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
|
||||
|
@ -53,7 +53,7 @@ struct dist {
|
||||
* We define this conditionally to suppress false positives from
|
||||
* Coverity, which gets confused by the sizeof business.
|
||||
*/
|
||||
#ifdef __COVERITY___
|
||||
#ifdef __COVERITY__
|
||||
#define TYPE_CHECK_OBJ(OPS, OBJ, TYPE) 0
|
||||
#else
|
||||
#define TYPE_CHECK_OBJ(OPS, OBJ, TYPE) \
|
||||
|
Loading…
Reference in New Issue
Block a user