diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-04-11 18:38:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-04-11 18:38:59 -0400 |
commit | 55690d05bd8856798d2e6f6b56261629847c068b (patch) | |
tree | e56d6cef2013a06ae8d61b0de6523f018ddbe5b4 /src/feature/client | |
parent | adeecce53b68eb7183bf8d5b3051303b5f2f1d45 (diff) | |
download | tor-55690d05bd8856798d2e6f6b56261629847c068b.tar.gz tor-55690d05bd8856798d2e6f6b56261629847c068b.zip |
Add an assertion to pathbias_get_scale_ratio()
This should please coverity, and fix CID 1415723. It didn't understand
that networkstatus_get_param() always returns a value between its
minimum and maximum values.
Diffstat (limited to 'src/feature/client')
-rw-r--r-- | src/feature/client/circpathbias.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/feature/client/circpathbias.c b/src/feature/client/circpathbias.c index 1743ab5a81..e6af649ba7 100644 --- a/src/feature/client/circpathbias.c +++ b/src/feature/client/circpathbias.c @@ -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 |