[or-cvs] [tor/master 4/4] Add a note about _compare_int not doing overflow right

nickm at torproject.org nickm at torproject.org
Mon Jan 3 17:01:34 UTC 2011


Author: Nick Mathewson <nickm at torproject.org>
Date: Mon, 3 Jan 2011 12:03:21 -0500
Subject: Add a note about _compare_int not doing overflow right
Commit: 93a6d53ef33f61a711c7a5b0583dae88a160d730

---
 src/or/rephist.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/or/rephist.c b/src/or/rephist.c
index 451db69..3146d70 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1982,7 +1982,9 @@ rep_hist_exit_stats_term(void)
   tor_free(exit_streams);
 }
 
-/** Helper for qsort: compare two ints. */
+/** Helper for qsort: compare two ints.  Does not handle overflow properly,
+ * but works fine for sorting an array of port numbers, which is what we use
+ * it for. */
 static int
 _compare_int(const void *x, const void *y)
 {
-- 
1.7.1



More information about the tor-commits mailing list