]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
stop taking strlen of an uninitialized buffer
authorRoger Dingledine <arma@torproject.org>
Wed, 18 Aug 2004 09:49:17 +0000 (09:49 +0000)
committerRoger Dingledine <arma@torproject.org>
Wed, 18 Aug 2004 09:49:17 +0000 (09:49 +0000)
we were (are?) printing garbage in the rephist stats

svn:r2284

src/or/rephist.c

index c94b19fa15ef586c5dafcb022c8b60e18c71d50b..603077ce5dcb290fd8ecbc31ea71fa522200ce28 100644 (file)
@@ -266,9 +266,10 @@ void rep_hist_dump_stats(time_t now, int severity)
         or_history->n_conn_ok, or_history->n_conn_fail+or_history->n_conn_ok,
         upt, upt+downt, uptime*100.0);
 
-    if (!strmap_isempty(or_history->link_history_map)) {
+    if (!strmap_isempty(or_history->link_history_map))
       strcpy(buffer, "    Good extend attempts: ");
-    }
+    else
+      *buffer = '\0';
     len = strlen(buffer);
     for (lhist_it = strmap_iter_init(or_history->link_history_map);
          !strmap_iter_done(lhist_it);