diff options
author | Nick Mathewson <nickm@torproject.org> | 2021-03-18 13:30:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2021-03-18 13:30:49 -0400 |
commit | cd0e5a942eee0f08f4311899c09c6783b2c8e22c (patch) | |
tree | 8424fb456745a35617c20e4f5782f3c8b85c6a84 /src/feature/stats/rephist.c | |
parent | 411db63fc36878af2627e43d3e64f607a1979a92 (diff) | |
download | tor-cd0e5a942eee0f08f4311899c09c6783b2c8e22c.tar.gz tor-cd0e5a942eee0f08f4311899c09c6783b2c8e22c.zip |
Terminate rep_hist_get_overload_stats_lines() with an NL.tor-0.4.6.1-alpha
We use it in router.c, where chunks are joined with "", not with
NL... so leaving off the terminating NL will lead to an unparseable
extrainfo.
Found by toralf. Bug not in any released Tor.
Diffstat (limited to 'src/feature/stats/rephist.c')
-rw-r--r-- | src/feature/stats/rephist.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/feature/stats/rephist.c b/src/feature/stats/rephist.c index 7c0c28804c..4ad5d46b0c 100644 --- a/src/feature/stats/rephist.c +++ b/src/feature/stats/rephist.c @@ -233,7 +233,7 @@ rep_hist_get_overload_stats_lines(void) /* First encode the general overload */ if (overload_happened_recently(overload_stats.overload_general_time, 72)) { format_iso_time(tbuf, overload_stats.overload_general_time); - smartlist_add_asprintf(chunks, "overload-general %d %s", + smartlist_add_asprintf(chunks, "overload-general %d %s\n", OVERLOAD_STATS_VERSION, tbuf); } @@ -243,7 +243,7 @@ rep_hist_get_overload_stats_lines(void) format_iso_time(tbuf, overload_stats.overload_ratelimits_time); smartlist_add_asprintf(chunks, "overload-ratelimits %d %s %" PRIu64 " %" PRIu64 - " %" PRIu64 " %" PRIu64, + " %" PRIu64 " %" PRIu64 "\n", OVERLOAD_STATS_VERSION, tbuf, options->BandwidthRate, options->BandwidthBurst, overload_stats.overload_read_count, @@ -254,7 +254,7 @@ rep_hist_get_overload_stats_lines(void) if (overload_happened_recently( overload_stats.overload_fd_exhausted_time, 72)) { format_iso_time(tbuf, overload_stats.overload_fd_exhausted_time); - smartlist_add_asprintf(chunks, "overload-fd-exhausted %d %s", + smartlist_add_asprintf(chunks, "overload-fd-exhausted %d %s\n", OVERLOAD_STATS_VERSION, tbuf); } @@ -263,7 +263,7 @@ rep_hist_get_overload_stats_lines(void) goto done; } - result = smartlist_join_strings(chunks, "\n", 0, NULL); + result = smartlist_join_strings(chunks, "", 0, NULL); done: SMARTLIST_FOREACH(chunks, char *, cp, tor_free(cp)); |