[or-cvs] r20806: {tor} update svn to afc76a4e714a192e76281793f39c412c87964e46 for c (in tor/trunk/src: common or)

nickm at seul.org nickm at seul.org
Tue Oct 20 03:22:47 UTC 2009


Author: nickm
Date: 2009-10-19 23:22:46 -0400 (Mon, 19 Oct 2009)
New Revision: 20806

Modified:
   tor/trunk/src/common/container.c
   tor/trunk/src/or/dirvote.c
Log:
update svn to afc76a4e714a192e76281793f39c412c87964e46 for coverity.

Modified: tor/trunk/src/common/container.c
===================================================================
--- tor/trunk/src/common/container.c	2009-10-19 04:56:36 UTC (rev 20805)
+++ tor/trunk/src/common/container.c	2009-10-20 03:22:46 UTC (rev 20806)
@@ -470,26 +470,26 @@
   const void *most_frequent = NULL;
   int most_frequent_count = 0;
 
-  const void **cur = NULL;
+  const void *cur = NULL;
   int i, count=0;
 
   if (!sl->num_used)
     return NULL;
   for (i = 0; i < sl->num_used; ++i) {
     const void *item = sl->list[i];
-    if (cur && 0 == compare(cur, &item)) {
+    if (cur && 0 == compare(&cur, &item)) {
       ++count;
     } else {
       if (cur && count >= most_frequent_count) {
-        most_frequent = *cur;
+        most_frequent = cur;
         most_frequent_count = count;
       }
-      cur = &item;
+      cur = item;
       count = 1;
     }
   }
   if (cur && count >= most_frequent_count) {
-    most_frequent = *cur;
+    most_frequent = cur;
     most_frequent_count = count;
   }
   return (void*)most_frequent;

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2009-10-19 04:56:36 UTC (rev 20805)
+++ tor/trunk/src/or/dirvote.c	2009-10-20 03:22:46 UTC (rev 20806)
@@ -2794,7 +2794,7 @@
 dirvote_format_microdesc_vote_line(char *out, size_t out_len,
                                    const microdesc_t *md)
 {
-  char d64[BASE64_DIGEST256_LEN];
+  char d64[BASE64_DIGEST256_LEN+1];
   if (!microdesc_consensus_methods) {
     microdesc_consensus_methods =
       make_consensus_method_list(MIN_METHOD_FOR_MICRODESC,



More information about the tor-commits mailing list