diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2011-02-24 16:44:54 +0100 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2011-02-24 16:44:54 +0100 |
commit | 0642b927928df4ec556a76fed4b0b4523d515a7d (patch) | |
tree | aea5f23bfe853b00183195bcfb6d13dbc6f4b025 /src/or/rephist.c | |
parent | 80253ba4d77a95ab14ee80dbc4eea88bb264124c (diff) | |
download | tor-0642b927928df4ec556a76fed4b0b4523d515a7d.tar.gz tor-0642b927928df4ec556a76fed4b0b4523d515a7d.zip |
Fix two potential bugs in the bug1863 code.
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r-- | src/or/rephist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index 265fff8a37..3f4a70418b 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -1513,7 +1513,7 @@ rep_hist_update_bwhist_state_section(or_state_t *state, smartlist_free(*s_values); } if (*s_maxima) { - SMARTLIST_FOREACH(*s_values, char *, val, tor_free(val)); + SMARTLIST_FOREACH(*s_maxima, char *, val, tor_free(val)); smartlist_free(*s_maxima); } if (! server_mode(get_options())) { @@ -1541,7 +1541,7 @@ rep_hist_update_bwhist_state_section(or_state_t *state, i = (b->num_maxes_set <= b->next_max_idx) ? 0 : b->next_max_idx; for (j=0; j < b->num_maxes_set; ++j,++i) { uint64_t maxval; - if (i > NUM_TOTALS) + if (i >= NUM_TOTALS) i = 0; tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(b->totals[i] & ~0x3ff)); smartlist_add(*s_values, cp); |