summaryrefslogtreecommitdiff
path: root/src/or/circuitstats.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-25 11:51:15 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-26 12:25:01 -0400
commit4d11a468b20a116978f89115a75cdc45fe5da8ad (patch)
treee8d45392014b39707a9bbfb6af9be3549175c55d /src/or/circuitstats.c
parenteb54a856a298aff8b2cdadf87247a33a74921c49 (diff)
downloadtor-4d11a468b20a116978f89115a75cdc45fe5da8ad.tar.gz
tor-4d11a468b20a116978f89115a75cdc45fe5da8ad.zip
Correct two state-file variable types.
These should have been int, but we had listed them as unsigned. That's an easy mistake to make, since "int" corresponds with either INT or UINT in the configuration file. This bug cannot have actually caused a problem in practice, since we check those fields' values on load, and ensure that they are in range 0..INT32_MAX.
Diffstat (limited to 'src/or/circuitstats.c')
-rw-r--r--src/or/circuitstats.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c
index ad0630e27e..923a6d794f 100644
--- a/src/or/circuitstats.c
+++ b/src/or/circuitstats.c
@@ -910,7 +910,7 @@ circuit_build_times_parse_state(circuit_build_times_t *cbt,
int tot_values = 0;
uint32_t loaded_cnt = 0, N = 0;
config_line_t *line;
- unsigned int i;
+ int i;
build_time_t *loaded_times;
int err = 0;
circuit_build_times_init(cbt);
@@ -960,8 +960,8 @@ circuit_build_times_parse_state(circuit_build_times_t *cbt,
break;
}
- if (loaded_cnt+count+state->CircuitBuildAbandonedCount
- > state->TotalBuildTimes) {
+ if (loaded_cnt+count+ (unsigned)state->CircuitBuildAbandonedCount
+ > (unsigned) state->TotalBuildTimes) {
log_warn(LD_CIRC,
"Too many build times in state file. "
"Stopping short before %d",
@@ -986,7 +986,7 @@ circuit_build_times_parse_state(circuit_build_times_t *cbt,
loaded_times[loaded_cnt++] = CBT_BUILD_ABANDONED;
}
- if (loaded_cnt != state->TotalBuildTimes) {
+ if (loaded_cnt != (unsigned)state->TotalBuildTimes) {
log_warn(LD_CIRC,
"Corrupt state file? Build times count mismatch. "
"Read %d times, but file says %d", loaded_cnt,