[or-cvs] r13602: Explain why I am right and veracode is wrong in routerparse. (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Tue Feb 19 23:57:06 UTC 2008


Author: nickm
Date: 2008-02-19 18:57:06 -0500 (Tue, 19 Feb 2008)
New Revision: 13602

Modified:
   tor/trunk/
   tor/trunk/src/or/routerparse.c
Log:
 r18236 at catbus:  nickm | 2008-02-19 18:55:21 -0500
 Explain why I am right and veracode is wrong in routerparse.c line 1141.  Using math!



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r18236] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c	2008-02-19 23:54:17 UTC (rev 13601)
+++ tor/trunk/src/or/routerparse.c	2008-02-19 23:57:06 UTC (rev 13602)
@@ -1133,6 +1133,12 @@
       memcpy(cp, prepend_annotations, prepend_len);
       cp += prepend_len;
     }
+    /* This assertion will always succeed.
+     * len == signed_desc_len + annotations_len
+     *     == end-s + s-start_of_annotations + prepend_len
+     *     == end-start_of_annotations + prepend_len
+     * We already wrote prepend_len bytes into the buffer; now we're
+     * writing end-start_of_annotations -NM. */
     tor_assert(cp+(end-start_of_annotations) ==
                router->cache_info.signed_descriptor_body+len);
     memcpy(cp, start_of_annotations, end-start_of_annotations);



More information about the tor-commits mailing list